You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by he...@teradyne.com on 2003/05/30 04:04:15 UTC

HTML select multiple and actionForm with collection

Help?!

I have an action form with a collection as a  member. The actionform has
only getSelected and setSelected(selected is the name of the
collection)
My web page has a multiple select list containing many values. When I
submit (having several values selected) I expect the selected
values(Strings) to be put into the collection of the ActionForm.  But
instead I get a root cause exception of java.lang.IllegalArgumentException:
argument type mismatch.

It seems it's trying to convert a String to a collection? Where am I going
wrong?

thx,
Henrik Bentel



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


Re: HTML select multiple and actionForm with collection

Posted by Vic Cekvenich <vc...@baseBeans.com>.
A bean backed by a collection is a good idea and it make multi row 
processing easy, and DAO feeds easy; my beans have a list property as 
you do.

I solved your issues here:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/basicportal/bP/WEB-INF/src/war/com/baseBeans/scaffoldingXPress/base/BaseBean.java
via making a form bean implement a collection w/ iterator adaptor that 
 ... iterates (the real) list.

hth,
.V

henrik.bentel@teradyne.com wrote:

>Help?!
>
>I have an action form with a collection as a  member. The actionform has
>only getSelected and setSelected(selected is the name of the
>collection)
>My web page has a multiple select list containing many values. When I
>submit (having several values selected) I expect the selected
>values(Strings) to be put into the collection of the ActionForm.  But
>instead I get a root cause exception of java.lang.IllegalArgumentException:
>argument type mismatch.
>
>It seems it's trying to convert a String to a collection? Where am I going
>wrong?
>
>thx,
>Henrik Bentel
>  
>

-- 
Vic Cekvenich,
Struts Instructor,
1-800-917-JAVA

Advanced <a href ="baseBeans.com">Struts Training</a> and project recovery in North East.
Open Source <a href ="baseBeans.com">Content Management</a>  basicPortal sofware
Best practice<a href ="baseBeans.com">Struts Support</a> v.1.1 helper ScafflodingXPress




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