You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Vaibhav Lolge <va...@gmail.com> on 2008/09/27 15:48:44 UTC
ListMultipleChoice Defalut Selection
Hi,
I have a piece of code that uses ListMultipleChoice . I do some action
depending on the selected item in the list (eg: The List is a list of
categories of cars and on click of these there are subcategories shown).
A user then saves this is the DB. A user can edit his preferences from the
list, hence he is brought back to the same page. Now, I get the values from
the DB, but I fail to understand, how do I show these items as selected in
ListMultipleChoice ?
Please suggest. A quick reply is really appreciated.
Thanks in advance.
--
View this message in context: http://www.nabble.com/ListMultipleChoice-Defalut-Selection-tp19702889p19702889.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: ListMultipleChoice Defalut Selection
Posted by Eyal Golan <eg...@gmail.com>.
If you use PropertyModel or CompoundPropertyModel you can set the field(s)
that your component is attached to.
A DropDown example (I'm not experienced with multiple choice lists):
private String name;
..
DropDownChoice ddc = new DropDownChoice("name", new PropertyModel(this,
"name"), choicesModel);
name = MyDao.getMyDefaultName();
Hope that helps
On Sat, Sep 27, 2008 at 4:48 PM, Vaibhav Lolge <va...@gmail.com>wrote:
>
> Hi,
> I have a piece of code that uses ListMultipleChoice . I do some action
> depending on the selected item in the list (eg: The List is a list of
> categories of cars and on click of these there are subcategories shown).
> A user then saves this is the DB. A user can edit his preferences from the
> list, hence he is brought back to the same page. Now, I get the values from
> the DB, but I fail to understand, how do I show these items as selected in
> ListMultipleChoice ?
> Please suggest. A quick reply is really appreciated.
> Thanks in advance.
> --
> View this message in context:
> http://www.nabble.com/ListMultipleChoice-Defalut-Selection-tp19702889p19702889.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
>
>
--
Eyal Golan
egolan74@gmail.com
Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74
P Save a tree. Please don't print this e-mail unless it's really necessary