[Logo]
Forums Register Login
html:multibox Retrieving values
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
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 ]
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
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards



All times above are in ranch (not your local) time.
The current ranch time is
Nov 19, 2017 07:30:00.