You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by eugenebalt <eu...@yahoo.com> on 2010/12/21 16:23:11 UTC
Set Current DropDownChoice Item (Selected)
How do I set the DropDownChoice to a particular choice (item) of the list?
My DropDownChoice has items X,Y,Z. I would like to set the currently
selected item to Y.
I have the method setChoices(..) which lets me initialize the list, but is
there a method to select an item by index?
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Set-Current-DropDownChoice-Item-Selected-tp3154886p3154886.html
Sent from the Users forum 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: Set Current DropDownChoice Item (Selected)
Posted by eugenebalt <eu...@yahoo.com>.
Thanks.
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Set-Current-DropDownChoice-Item-Selected-tp3154886p3159534.html
Sent from the Users forum 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: Set Current DropDownChoice Item (Selected)
Posted by Andrea Del Bene <ad...@ciseonweb.it>.
HI,
suppose that your choices list is called choicesList and your
DropDownChoice is called options you should write something like:
options.setModelObject(choicesList.get(i));
> How do I set the DropDownChoice to a particular choice (item) of the list?
>
> My DropDownChoice has items X,Y,Z. I would like to set the currently
> selected item to Y.
>
> I have the method setChoices(..) which lets me initialize the list, but is
> there a method to select an item by index?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Set Current DropDownChoice Item (Selected)
Posted by Alexander Monakhov <do...@gmail.com>.
Hello.
Use setModel() in this case.
Best regards, Alexander.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org