The example referenced by Jörg Maurer is available in Struts 1.0.2 as well.  It 
includes the following

  <tr>
    <th align="right">Multiple Select Allowed:</th>
    <td align="left">
      <html:select property="multipleSelect" size="10" multiple="true">
        <html:options name="multipleValues" labelName="multipleValues"/>
      </html:select>
    </td>
  </tr>

which is identical to what you are trying to accomplish.  

As you are probably aware, the property "multipleSelect" here ("ids" in your case) 
holds the selected values while "multipleValues"  is the collection of available 
options.  However the snippet you have sent in one of your emails has

<html:select property="ids" multiple="true">
<html:options property="ids"/>
</html:select>

Looking at your form bean definition I think what you are trying to do is display 
"Zero", "One" but have the values "0" and "1" submitted.  What you have to do is to 
set up LabelValueBeans with the necessary name and value.  I *think* LabelValueBeans 
are part of Struts 1.0.2; if not simply create a JavaBean with "name" and "value" 
properties and make a collection of them.  Look at the docs for <html:options> on how 
to use it.

Also, ensure that your <html:select> is inside a <html:form>

Sri

-----Original Message-----
From: Ian Hunter [mailto:[EMAIL PROTECTED] 
Sent: Sunday, February 23, 2003 11:03 PM
To: Struts Users Mailing List
Subject: Re: <html:select> "multiple" problems


OK.  Let me narrow down my question somewhat.

In Struts 1.0.2, what method in an ActionForm is called after an input JSP containing 
an <html:select multiple="true" property="ids"> tag, assuming the property ids is a 
String[]?

Does it look like

public void setIds(Object[] ids)
or
public void setIds(String[] ids)
or
public void setIds(ArrayList ids)
or what?

Seems like no matter what setter method I provide, it doesn't get called.

----- Original Message -----
From: "Ian Hunter" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Sunday, February 23, 2003 9:20 PM
Subject: <html:select> "multiple" problems


> AAAARGGGGGH!!!!
>
> I would give one of my legs right now for a working example of an 
> <html:select multiple="true"> usage that populates an array in an 
> ActionForm.
>
> Help?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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


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

Reply via email to