Thanks Sri for the help. I have updated the code to reflect your
suggestions. I actually had an ArrayList in there originally and I changed
it to an String[] because I was receiving the following error.

javax.servlet.ServletExcepion: BeanUtils.populate
...

----------- Root Cause --------------
java.lang.IllegalArgumentException: Argument Type Mismatch

Obviously I am trying to pass the wrong kind of value into the method but I
am not sure how to get around this. Any more suggestions?

thanks again for your help

Jordan

-----Original Message-----
From: Sri Sankaran [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 23 January 2003 3:27 PM
To: Struts Users Mailing List
Subject: RE: How to handle a multiple select tag


Is this setter being called at all?  If the 'permissions' property of your
form-bean is some kind of List (as it seems looking at the setter you have
shown) I don't think this setter will be invoked at all.  Struts will look
for a

  void setPermissions(List x)

method.  Likewise when you displayed the page Struts would have obtained the
default selection(s) from calling a

  List getPermissions()

method.

I haven't given you a definitive answer but hopefully this provided a clue.

Sri

> -----Original Message-----
> From: Jordan Thomas [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 23, 2003 6:51 AM
> To: Struts User List
> Subject: How to handle a multiple select tag
>
>
> Hi,
>
> I have a form that has an <html:select> tag that looks like this:
>
> <html:select property="permissions" multiple="true" size="10"
> tabindex="5">
>     <html:options collection="allPermissions" property="permissionId"
>         labelProperty="permissionName"/>
> </html:select>
>
> This renders out as intended but when I submit my form to an
> ActionForm that has a method that looks like this:
>
>
> public void setPermissions( String[] permissions ) {
>         Integer permissionId = null;
>         for (int i = 0; i < permissions.length; i++){
>             permissionId = new Integer(permissions[i]);
>             this.permissions.add( new
> PermissionData(permissionId, null) );
>         }
>     }
>
> This essentially takes the permissions and adds them to a
> Collection. For some reason though, the permissions String[]
> is null. Why isn't this getting submitted?
>
> thanks for your help
>
> Jordan
>
>
> --
> To unsubscribe, e-mail:
> <mailto:struts-user-> [EMAIL PROTECTED]>
> For
> additional commands,
> e-mail: <mailto:[EMAIL PROTECTED]>
>
>

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to