I 'm wondering if the problem posted by Jonathan Cone (below) had been solved. I also come across with similar problem where ListMultipleChoice is unable to reference to all selected item, instead it is only refering to the last selected item.
I 'm currently using wicket 1.1.1.
Thanks very much.
Michael
On 2/10/06, Jonathan Cone <[EMAIL PROTECTED]> wrote:
>
> Description:
> I'm using a ListMultipleChoice component to populate a List model object.
> When the user selects multiple items in the list, I want the list model
> object to be populated with those items.
>
> Problem:
> The ListMultipleChoice renders correctly with all the proper 'choices' and
> corresponding 'id's from the choice List I provide it. The problem occurs
> when I try to submit the form with multiple items selected. After each
> submit, the model is only updated with one of the selected items - the
> last
> item in the selection chain. For example, if I submit a form with "A" "B"
> and "C" selected (top to bottom). The model List only contains "C".
>
> Desired Result:
> I would like the model List to contain references to ALL of the selected
> objects in the ListMultipleChoice. Any suggestions on what I'm doing
> wrong?
>
> Here is the code (1.2-20060122):
>
> ChoiceRenderer renderer = new ChoiceRenderer("name","id");
>
> // ListMultipleChoice(id, model, choice list)
>
> unitAmenities = new ListMultipleChoice("unitAmenities",
> new PropertyModel(unit, "unitAmenities"), Arrays
> .asList(AmenityType.values()));
> unitAmenities.setChoiceRenderer(renderer);
>
>
> Now 'unitAmenities' is a List<AmenityType> and AmenityType is a 5.0
> enumeration containing a 'name' and 'id' String fields. I have, however,
> tried replacing the enumeration with a concrete class and a static method
> to
> supply list values to no avail. 'unit' is a model object containing the
> 'unitAmenities' list.
>
> Here is the simple HTML I'm using to bind this component to
> 'unitAmenities':
>
> <select multiple="multiple" wicket:id="unitAmenities"
> id="unitAmenities"></select>
>
> Thanks in advance.
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
> _______________________________________________
> Wicket-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
Yahoo! Mail
Bring photos to life! New PhotoMail makes sharing a breeze.