Try setting the compoundmodel on the form and the form of the
dropdownchoice to null.
compoundmodels operate by checking if a parent has a compoundmodel,
the component holding the compoundmodel will behave just like a normal
model and return the actual object instead of one of its properties.
Alternatively you can use a PropertyModel on the dropdownchoice
instead of a compoundmodel.
Maurice
On Mon, Mar 24, 2008 at 9:16 PM, tdelesio <[EMAIL PROTECTED]> wrote:
>
> Is it possible to use two objects in a dropdown choice. For instance in the
> below code I want to use the class Pizza for the model of the form but load
> it with a list of toppings. When I do it the model of the form is getting
> set to Topping when I expect it to be Pizza. Thanks for the help.
>
> public class Pizza
> {
>
> private String selectedTopping;
> private String name;
> }
>
> public class Toppings
> {
> pirvate int id;
> private String name;
> }
>
> List<Toppings> toppingList = some list from a databae....
>
> final DropDownChoice comboChoiceDropDown = new DropDownChoice(
> "selectedTopping", new
> CompoundPropertyModel(new Pizza()),
> toppingList, new ChoiceRenderer("lid", "name"));
>
> --
> View this message in context:
> http://www.nabble.com/Dropdown-Choices-tp16259995p16259995.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]