If i understand your problem, I had same problem last week, this is my solution 

in the formbean : 
   public void reset(ActionMapping mapping, HttpServletRequest request)
   {  
        // init formbean
        setText_search(" ");
        setType_search("Begin");
   } 

   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request)
   {  
        
                
    // if action is not triggered by reset button, validate the data
    if (request.getParameter("reset") == null)
    {
      ...........

           }
        }
        else  // if action triggered by reset button, initialise data
           {
                   reset(mapping, request);
                   request.removeAttribute("reset");
           }   
     
        return errors;
   }

in the jsp : 
   <html:form method="POST"  action="/freeSearch.do" >
                <html:radio property="type_search" value="Begin"/> A 
                <BR>
                <html:radio property="type_search" value="Middle" /> B
                <BR>
                <html:text  property="text_search" size="40" maxlength="80"/>
                <html:submit value="Search" />
                <html:submit  value="reset" property="reset"/>
     </html:form>

JML
[EMAIL PROTECTED]


-----Original Message-----
From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]] 
Sent: jeudi 1 août 2002 00:04
To: 'Struts Users Mailing List'
Subject: RE: Reset button does not invoke the FormBean's reset()


I am not sure what are you talking about.
Anyway, if you have a suggestion please 
let me know. What I explained you wasn't
clear I guess.I press the reset button and 
the radio buttons don't get cleared. Any
ideas ?(only one this time) 
Thanks
Priyank

-----Original Message-----
From: James Mitchell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 5:46 PM
To: Struts Users Mailing List
Subject: RE: Reset button does not invoke the FormBean's reset()


Ok, first of all,  its probably not a good idea to have.. 'when the user hits the back 
button it should...' in any of your use cases....but since we all deal the cards we 
are dealt, lets deal with this.

The user hitting the back button has nothing to do with the scope of your bean. When 
the user hits back, the page is pulled from memory on the users pc (or from disk, 
depending on which browser and version)

If the user then hits the reset button, the form should clear back to original values.

This reminds me about a debate I had with PHBs over the difference between "resetting 
the form" and "clearing the form".  They lost of course.

Anyway, hope that helps you a little.

James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the "Open Minded Developer Network" 
http://www.open-tools.org/struts-atlanta




> -----Original Message-----
> From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 31, 2002 5:13 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Reset button does not invoke the FormBean's reset()
>
>
> I need the bean in Session scope , so that
> when the user returns to the same page using
> the back button he should see the radio buttons
> selected. He should not lose the selections.Only
> when he presses the reset button the radio buttons
> should clear.Any ideas , how to do it ???
> Thanks
> Priyank
>
> -----Original Message-----
> From: James Mitchell [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 31, 2002 5:09 PM
> To: Struts Users Mailing List
> Subject: RE: Reset button does not invoke the FormBean's reset()
>
>
> What scope did you define for this formbean?
>
> James Mitchell
> Software Engineer\Struts Evangelist
> Struts-Atlanta, the "Open Minded Developer Network" 
> http://www.open-tools.org/struts-atlanta
>
>
>
>
> > -----Original Message-----
> > From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, July 31, 2002 4:50 PM
> > To: 'Struts Users Mailing List'
> > Subject: RE: Reset button does not invoke the FormBean's reset()
> >
> >
> > Yeah I figured that out. But my problem is little tricky.
> > I have a set of radio buttons and when I select them , the selected 
> > values automatically get set in a String[]. Now, when I try to reset 
> > the values back to the original state i.e. all radio buttons 
> > unselected , I just reset the String[] back to the original state in 
> > the reset method. When I click the reset button I should see all 
> > radio radio buttons getting unselected but it's not happening. 
> > Something wrong with my browser settings :( Any help Keith ..
> >
> > Thanks
> > Priyank
> >
> > -----Original Message-----
> > From: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, July 31, 2002 4:39 PM
> > To: 'Struts Users Mailing List'
> > Subject: RE: Reset button does not invoke the FormBean's reset()
> >
> >
> > Hey,
> > This is a mistake I made at first too.  One would assume that a 
> > reset button would call the reset method, but this is not the case.  
> > The reset method is
> > called when an action is forwarding to a JSP with a form/form
> bean.  It's
> > mainly used to set the boolean properties associated with a checkbox 
> > to false, so that they are correctly updated.  (Checkboxes kinda 
> > suck like that).  The reset button is used differently.  It only 
> > gets rid
> of changes
> > made since you last submitted the form, meaning that it changes
> the fields
> > back to what they were when you arrived at the form.  The method and 
> > button are two completely different things.  Does that make sense to 
> > you? I hope this helps.
> >
> > ~ Keith
> > http://www.buffalo.edu/~kkamholz
> >
> >
> >
> > -----Original Message-----
> > From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, July 31, 2002 4:33 PM
> > To: 'Struts Users Mailing List'
> > Subject: Reset button does not invoke the FormBean's reset()
> >
> >
> > Hi All,
> >  I am not able to invoke FromBean's reset() method from the browser. 
> > I have a form with two buttons Submit and Reset. When I click the 
> > reset button I am not able to invoke the reset() of the FormBean. 
> > Any help will be great. Thanks
> > Priyank
> >
> > --
> > To unsubscribe, e-mail: 
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail: 
> > <mailto:[EMAIL PROTECTED]>
> >
>
>
> --
> To unsubscribe, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
>


--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
Visit our website! http://www.nbb.be

"DISCLAIMER: The content of this e-mail message should not be constructed as binding 
for the National Bank of Belgium (NBB) unless otherwise and previously stated.
Besides, the opinions expressed in this message are solely those of the author and do 
not necessarily represent those of the NBB, which is particularly the case if the 
content of the present message, or part of it, is of a private nature or does not come 
whithin the professional scope of the author."








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

Reply via email to