You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bjørn Erik Andersson <an...@dph.no> on 2001/07/09 13:59:27 UTC

reset-method

Hello,

Does anyone have any code examples or information on how to write the reset() -method in order to reset only checkboxes in a form (and still keep any textbox values etc) ? This to avoid the unselect problems in checkboxes using Struts.

Thanks in advance,

Bjørn Erik Andersson

Re: reset-method

Posted by Ted Husted <hu...@apache.org>.
The default reset() method does not do anything, so the fields you do
not change yourself would not be changed. 

The general advice is to use booleans for checkboxes and set them to
false in reset(). 

Reset() is called before the ActionForm is populated from the request,
and would not change any values (unless you are trying to pass the form
between Actions).

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 737-3463.
-- http://www.husted.com/about/struts/


> Bjørn Erik Andersson wrote:
> 
> Hello,
> 
> Does anyone have any code examples or information on how to write the
> reset() -method in order to reset only checkboxes in a form (and still
> keep any textbox values etc) ? This to avoid the unselect problems in
> checkboxes using Struts.
> 
> Thanks in advance,
> 
> Bjørn Erik Andersson