Yeah - I'm looking at that.  My problem now is how to get the value for each 
checkbox.  My bean has an "id" property - so I have tried this kind of 
thing:

<logic:iterate id="retailer" name="retailerForm" property="retailers">
        <tr>
        <td><html:checkbox name="retailer" property="delete" value="<bean:write 
name="retailer" property="id"/>"/></td>
        <td><bean:write name="retailer" property="id"/></td>
        <td><html:text name="retailer" property="name"/></td>
        </tr>
</logic:iterate>

But it doesn't like having the bean:write embedded there.  Am I missing 
something obvious?

Many thanks
Tony



>From: Peter Alfors <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Subject: Re: Checkbox Arrays
>Date: Thu, 10 May 2001 11:09:18 -0500
>
>Im not sure how the ActionForm changes things, but without an actionform 
>your
>could do this....
>
>Each checkbox can have the same name, but a different value.
>When the form is submitted, the checkboxes that have been checked are in 
>the
>request.
>You can use the request.getParameterValues("checkBoxName") to retrieve a 
>string
>array of the values for the checked boxes.
>
>HTH,
>     Pete
>
>Tony Karas wrote:
>
> > Can anyone help with this?
> >
> > I have an array of checkboxes in my ActionForm represented by
> >
> > boolean[] delete;
> >
> > and I have a setter function
> >
> > public void setDelete( boolean[] values )
> > {
> >         delete = values;
> > }
> >
> > The problem is that I have only checkboxes that are checked get sent 
>back -
> > so if one checkbox is checked all I get is an array of length 1.  
>Therefore,
> > it is not possible for me to determine which checkbox has been checked.
> >
> > In the documentation it tells me to use reset() in ActionForm to 
>initialise
> > the values - but this will only work with single checkboxes and not 
>arrays.
> >
> > I think I'm stuck.  Is there anyway I can determine which checkbox has 
>been
> > checked - maybe I can get the value to differ for each checkbox.  Will 
>look
> > in to that.
> >
> > Cheers
> > Tony
><< peter.alfors.vcf >>

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Reply via email to