Subject: Re: Using Reset with Checkboxes
From: Jose Quinteiro <[EMAIL PROTECTED]>
 ===
Javadoc sez:

Reset all bean properties to their default state. This method is called 
before the properties are repopulated by the controller servlet.

The default implementation does nothing. Subclasses should override this 
method to reset all bean properties to default values.

http://jakarta.apache.org/struts/api/org/apache/struts/action/ActionForm.html#reset(org.apache.struts.action.ActionMapping,%20javax.servlet.http.HttpServletRequest)

Ken Holzer wrote:
> Thanks for the information Jose.
> 
> Another question is when and where does the reset get called?
> 
> Ken
> "Jose Quinteiro" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]...
> 
>>You should check for the checkbox parameter(s) in the request, and set
>>it(them) to false if they are not present.
>>
>>For example, if you have a form called "Foo" with a boolean property
>>called "fubar" that is displayed a checkbox.
>>
>>In reset you would:
>>
>>public void reset( ActionMapping mapping,
>>                    javax.servlet.http.HttpServletRequest request )
>>{
>>if( request.getParameter("fubar") == null )
>>this.setFubar = false;
>>}
>>
>>Ken Holzer wrote:
>>
>>>Hi All,
>>>
>>>I am trying to understand how and when to use the reset with checkboxes.
>>>
>>>I have seen posting that say when using checkboxes on forms you must
>>
> reset
> 
>>>their value to false. When should this be done?
>>>
>>>I have a form that contains several checkboxes that get checked when the
>>>form opens based on some database values (that all is working). But when
>>
> I
> 
>>>check or uncheck these and then submit the form how do I see the
>>
> checkboxes
> 
>>>current value?
>>>
>>>Sorry if this is something that has already been answered, I searched
>>
> the
> 
>>>archive and did not see any specific responses, just to use reset.
>>>
>>>Thanks,
>>>
>>>Ken Holzer
>>>
>>>
>>
>>
> 
>


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

Reply via email to