You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Adam Murray <ad...@fortifysoftware.com> on 2004/08/18 03:33:56 UTC

multiselect form inputs only populate first string selected

When I try to use a multiselect input (html:select multiple="true"), it
works fine as long as the associated property is a String[]. However,
there's a situation where I have a dynamic list of form elements, each
of which has its own multiselect input. So I tried changing the property
to a List, but then only the first String selected on the webform is
populated in the applicable List index.

I threw in some debugging output in my ActionForm setter methods to try
to see what was going on. In the case where I use a String[] directly,
the object being set is a String[] as expected, but in the case where I
wrap a List around the property, the object being set is just a String.
I tried using a the Map-backed approach instead of a List, but with the
same results: I only see the first item selected off the multiselect
box, and never see the other strings that are selected.

Has anyone encountered this problem before? Is it perhaps a bug in
Struts or am I doing something wrong?

-Adam

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org