aspose file tools*
The moose likes Struts and the fly likes html:multibox Retrieving values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "html:multibox Retrieving values" Watch "html:multibox Retrieving values" New topic
Author

html:multibox Retrieving values

Ian Cox
Greenhorn

Joined: Feb 11, 2008
Posts: 9
Hi,

I see there are lots of posts on the html:multibox tag but I am struggling to locate one that solves this particular issue.

I have a struts form where all is well apart from I do not get the selections from the multibox when the form is submitted. The form class is as follows



And the jsp has the following to draw up the multibox



Having arranged for the element with ID of 4 to be checked I can see that the get bit is working correct as that checkbox is selected however I never get into the setSelectedItems.

Also, I do get the postcode field back its just the check box information.

What am I doing wrong please?
Ian
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The problem is in your setSelectedList method. You can't just cast a String array to a List. The java.util.Arrays object has an asList method that comes in handy in these situations. Example:

[ February 20, 2008: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
Ian Cox
Greenhorn

Joined: Feb 11, 2008
Posts: 9
Many thanks,

Fixed that and now everything links up correctly.

I had been led astray by some stuff on the google trail but it must have been work arounds for old issues and no longer applies.

Ian
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: html:multibox Retrieving values
 
Similar Threads
multibox functionality in struts
How to get unchecked multibox
multibox formating
Multibox reset method ?
Iterator and multibox