struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank Russo" <Frank.Ru...@sas.com>
Subject RE: [s2] Problem with no checkboxes selected
Date Fri, 20 Apr 2007 13:36:25 GMT
Sorry my response was too quick. I don't always realize the s2 in subject is there when I read
the posts. I'm not sure how to do this in s2...

-----Original Message-----
From: Zoran Avtarovski [mailto:zoran@sparecreative.com] 
Sent: Friday, April 20, 2007 9:29 AM
To: Struts Users Mailing List; Frank Russo
Subject: Re: [s2] Problem with no checkboxes selected

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:zoran@sparecreative.com]
> 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: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 



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


Mime
View raw message