Hi,

IModel<Person> personModel = getPersonModel();

List<Gender> genders = getGenderList();

DropDownChoice dropDownChoiceGender = new 
DropDownChoice("genderFieldId", new PropertyModel<Gender>(personModel,
"gender"), genderList);

Regards,

Bernard


On Thu, 2 Sep 2010 10:02:27 +0300, you wrote:

>Hello,
>the generics solution for the DropdownChoice is weird in my opinion.
>
>I want to write like this:
>
>List<Gender> genders = getGenderList();
>DropdownChoice<Person> new DropDownChoice<Person>("fieldId", new
>PropertyModel<Person>(currentPerson, "gender"), genders);
>
>But the compilation fails because of the mismatch between generics.
>Actually how to solve such situations? Wicket's generic's are quite
>weird in my opinion and I cannot understand them probably correctly...
>
>I want to assign object(in my case Gender to Person) from the list via
>PropertyModel to my object but cannot understand, how to do it. Did
>not find even any examples from the manual.
>
>Sigmar
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>For additional commands, e-mail: users-h...@wicket.apache.org


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

Reply via email to