Thanks Frank,

But I thought that form.reset() was only for s1. Does s2 even have a reset
method?

Z.


> Your form has to implement the ActionForm's reset method. In that method, you
> should set all of your boolean attributes to false. The reason has to do with
> http. Only checked checkboxes are submitted on a post request, and only
> attributes that are submitted have their setters called. If you set everything
> to false on reset, then the checkboxes that are checked will have their
> setter's called with true. The unchecked ones will stay false from the reset
> call...
> 
> -----Original Message-----
> From: Zoran Avtarovski [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 20, 2007 9:12 AM
> To: Struts Users Mailing List
> Subject: [s2] Problem with no checkboxes selected
> 
> I've run into a problem where when I edit a form which has check boxes.
> 
> 1. If I create a new object via the form and have no check boxes selected it
> works fine.
> 
> 2. If I create a new object via the form and have one or more check boxes
> selected it works fine.
> 
> 3. If I edit an object which has had one or more check boxes selected and
> deselect all the check boxes the object retains the previous values for the
> check box variable.
> 
> This clearly has something to with the fact the setter method is not being
> called if no check boxes are selected and my object values are somehow
> persisting beyond the request. What am I doing wrong here and is there a work
> around to this?
> 
> Please any pointers on this would be appreciated.
> 
> 
> Z.
> 
> 
> 
> ---------------------------------------------------------------------
> 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