You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by rjilani <ji...@lifebiosystems.com> on 2009/02/21 00:03:58 UTC

No get method defined for class error

Hi: guys I am getting "No get method defined for class RegisteredUser
expression: countryList" when I try to execute this code

registeredUser = new RegisteredUser();
            Address address = new Address();
            registeredUser.setAddress(address);
            model = new CompoundPropertyModel(registeredUser);
            setModel(model);
            add(new TextField("firstName", model.bind("firstName")));
            add(new TextField("lastName", model.bind("lastName")));
            add(new TextField("userName", model.bind("userName")));
            add(new TextField("emailAddress", model.bind("email")));
            add(new PasswordTextField("password", model.bind("password")));


            DropDownChoice countryList = new DropDownChoice("countryList",
model.bind("address.country"));
            countryList.setChoices(new AbstractReadOnlyModel() {

                public Object getObject() {
                    List list = null;
                    try {
                        ........
                }
            });

I don't understand why the errors happens at DropDownChoice even though the
model object has a complex property address that in turn has a property
called country. I am not sure what I am missing here

Thanks,
RJ


-- 
View this message in context: http://www.nabble.com/No-get-method-defined-for-class-error-tp22130142p22130142.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: No get method defined for class error

Posted by Martijn Dashorst <ma...@gmail.com>.
the ddc assumes your model.bind() is the list of items to select from,
which you conveniently overwrite after constructing the DDC. Read the
javadoc for each constructor parameter... then provide the readonly
model as a constructor parameter.

Martijn

On Sat, Feb 21, 2009 at 12:03 AM, rjilani <ji...@lifebiosystems.com> wrote:
>
> Hi: guys I am getting "No get method defined for class RegisteredUser
> expression: countryList" when I try to execute this code
>
> registeredUser = new RegisteredUser();
>            Address address = new Address();
>            registeredUser.setAddress(address);
>            model = new CompoundPropertyModel(registeredUser);
>            setModel(model);
>            add(new TextField("firstName", model.bind("firstName")));
>            add(new TextField("lastName", model.bind("lastName")));
>            add(new TextField("userName", model.bind("userName")));
>            add(new TextField("emailAddress", model.bind("email")));
>            add(new PasswordTextField("password", model.bind("password")));
>
>
>            DropDownChoice countryList = new DropDownChoice("countryList",
> model.bind("address.country"));
>            countryList.setChoices(new AbstractReadOnlyModel() {
>
>                public Object getObject() {
>                    List list = null;
>                    try {
>                        ........
>                }
>            });
>
> I don't understand why the errors happens at DropDownChoice even though the
> model object has a complex property address that in turn has a property
> called country. I am not sure what I am missing here
>
> Thanks,
> RJ
>
>
> --
> View this message in context: http://www.nabble.com/No-get-method-defined-for-class-error-tp22130142p22130142.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.5 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org