You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Gupta, Priyank x57787" <PG...@bis.adp.com> on 2002/08/01 00:04:15 UTC

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:jmitchtx@telocity.com]
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:PGupta@bis.adp.com]
> 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:jmitchtx@telocity.com]
> 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:PGupta@bis.adp.com]
> > 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:kkamholz@moog.com]
> > 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:PGupta@bis.adp.com]
> > 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:
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>