Re: Reset button not always working
The reset should change all values on your jsp page to those matching the html page, which would be populated by your ActionForm. In other words, if you haven't changed any of the values on your web page, then the reset would appear to do nothing. Is that the behavior you're expecting, or are you expecting it to do something else? It basically just resolves to the following html in the simplest case: --- input type=reset name=reset value=Reset --- At least that's my understanding. Regards, Oscar On Wed, 29 Oct 2003, ZYD wrote: Dear all, I have a Reset button on a Jsp page: html:reset bean:message key=button.reset/ /html:reset It works at first load. But when I forward to this page from other pages, this Reset button does nothing, it does not reset anything. Does this problem sound familiar to you guys? cheers bruce - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reset button.
This work thanks, here is the code for anyone else who is interested. script language=JavaScript1.2 function resetForm(myForm) { for(i=0, n=myForm.elements.length; i n; i++) { var theElement = myForm.elements[i]; if (theElement.type == 'text') { theElement.value = ''; } } } /script html:reset onclick=resetForm(this); return false;Reset/html:reset Gus Delgado wrote: no, not really, I'll give it a try thank you! -gus Durham David Cntr 805CSS/SCBE wrote: Gus, try going back a few posts to the javascript stuff. I think it's more in line with your original question. As a test try putting: input type=reset onClick=nameOfYourForm.firstTextField.value='';return false; on your page. replace nameOfYourForm and firstTextField with the appropriate names. I think you'll start to see where this is going. It's not hard, and there isn't a need for server side processing, unless there is, well, a need for server side processing. Is there? You haven't mentioned any. -Dave -Original Message- From: Gus Delgado [mailto:[EMAIL PROTECTED]] Sent: Monday, February 10, 2003 3:14 PM To: Struts Users Mailing List Subject: Re: Reset button. isReset() who's method is that, action, form? I can't seem to find it. -Gus Jacky Kimmel wrote: if (isReset(httpServletRequest)){ return actionMapping.findForward(Constants.D_RESET); } As you can see, I had a constants class that I refer to. Also, in the struts-config.xml I have mapped this forward back to the original jsp. I put this snippet of code in the beginning of each action class I have. Gus Delgado [EMAIL PROTECTED] wrote:how do I check for the reset in the Action? Jacky Kimmel wrote: It sounds like your action does not check to see if the reset was clicked or not. What I have done is do this check at the beginning of all my action classes. If the reset has been selected then the action is redirected to the empty jsp. It sounds like your action mapping may also not be corrected in your config file. Gus Delgado wrote:I have created a JSP with a Submit and Reset button both using the and tags. When I first render the page the reset works just fine, but if I hit the submit button and the page gets render again, I try to hit the reset and the form does not get clear anymore, the reset button does not work anymore, any ideas of why this is happening? any ways to fix it? thank you -Gus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] . - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] . - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reset button.
It sounds like your action does not check to see if the reset was clicked or not. What I have done is do this check at the beginning of all my action classes. If the reset has been selected then the action is redirected to the empty jsp. It sounds like your action mapping may also not be corrected in your config file. Gus Delgado [EMAIL PROTECTED] wrote:I have created a JSP with a Submit and Reset button both using the and tags. When I first render the page the reset works just fine, but if I hit the submit button and the page gets render again, I try to hit the reset and the form does not get clear anymore, the reset button does not work anymore, any ideas of why this is happening? any ways to fix it? thank you -Gus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now
Re: Reset button.
An html reset button resets all form fields to their initial values. Look at your html source and you will see something like input type=text value=blah The reset button is functioning properly. David From: Gus Delgado [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Reset button. Date: Mon, 10 Feb 2003 13:47:49 -0500 I have created a JSP with a Submit and Reset button both using the html:submit and html:reset tags. When I first render the page the reset works just fine, but if I hit the submit button and the page gets render again, I try to hit the reset and the form does not get clear anymore, the reset button does not work anymore, any ideas of why this is happening? any ways to fix it? thank you -Gus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Reset button.
Yeah, the reset button will return the form elements to their initial state. If the initial state includes values, i.e. input type=text value=someValue, then clicking reset will set the value of this element to someValue, it's original value. One solution is to write a function that loops throught the form elements and set text inputs to '' and so on. Something like input type=reset onclick=resetForm(this); return false; and then function would be: (untested) resetForm(theForm) { while (i = 0; i theForm.elements.length; i++) { theElement = theForm.elements[i]; if (theElement.type == 'text') { theElement.value = ''; } else if (theElement.type == 'choose-one') { theElement.selectedIndex = 1; } ... } If you're not sure what the type attribute will be for a form element, then you can alert(theElement.type). I might have some code I can dig up for this if you need more help. -Dave -Original Message- From: Gus Delgado [mailto:[EMAIL PROTECTED]] Sent: Monday, February 10, 2003 12:48 PM To: Struts Users Mailing List Subject: Reset button. I have created a JSP with a Submit and Reset button both using the html:submit and html:reset tags. When I first render the page the reset works just fine, but if I hit the submit button and the page gets render again, I try to hit the reset and the form does not get clear anymore, the reset button does not work anymore, any ideas of why this is happening? any ways to fix it? thank you -Gus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reset button.
how do I check for the reset in the Action? Jacky Kimmel wrote: It sounds like your action does not check to see if the reset was clicked or not. What I have done is do this check at the beginning of all my action classes. If the reset has been selected then the action is redirected to the empty jsp. It sounds like your action mapping may also not be corrected in your config file. Gus Delgado [EMAIL PROTECTED] wrote:I have created a JSP with a Submit and Reset button both using the and tags. When I first render the page the reset works just fine, but if I hit the submit button and the page gets render again, I try to hit the reset and the form does not get clear anymore, the reset button does not work anymore, any ideas of why this is happening? any ways to fix it? thank you -Gus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reset button.
if (isReset(httpServletRequest)) { return actionMapping.findForward(Constants.D_RESET); } As you can see, I had a constants class that I refer to. Also, in the struts-config.xml I have mapped this forward back to the original jsp. I put this snippet of code in the beginning of each action class I have. Gus Delgado [EMAIL PROTECTED] wrote:how do I check for the reset in the Action? Jacky Kimmel wrote: It sounds like your action does not check to see if the reset was clicked or not. What I have done is do this check at the beginning of all my action classes. If the reset has been selected then the action is redirected to the empty jsp. It sounds like your action mapping may also not be corrected in your config file. Gus Delgado wrote:I have created a JSP with a Submit and Reset button both using the and tags. When I first render the page the reset works just fine, but if I hit the submit button and the page gets render again, I try to hit the reset and the form does not get clear anymore, the reset button does not work anymore, any ideas of why this is happening? any ways to fix it? thank you -Gus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now
Re: Reset button.
isReset() who's method is that, action, form? I can't seem to find it. -Gus Jacky Kimmel wrote: if (isReset(httpServletRequest)) { return actionMapping.findForward(Constants.D_RESET); } As you can see, I had a constants class that I refer to. Also, in the struts-config.xml I have mapped this forward back to the original jsp. I put this snippet of code in the beginning of each action class I have. Gus Delgado [EMAIL PROTECTED] wrote:how do I check for the reset in the Action? Jacky Kimmel wrote: It sounds like your action does not check to see if the reset was clicked or not. What I have done is do this check at the beginning of all my action classes. If the reset has been selected then the action is redirected to the empty jsp. It sounds like your action mapping may also not be corrected in your config file. Gus Delgado wrote:I have created a JSP with a Submit and Reset button both using the and tags. When I first render the page the reset works just fine, but if I hit the submit button and the page gets render again, I try to hit the reset and the form does not get clear anymore, the reset button does not work anymore, any ideas of why this is happening? any ways to fix it? thank you -Gus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Reset button.
Gus, try going back a few posts to the javascript stuff. I think it's more in line with your original question. As a test try putting: input type=reset onClick=nameOfYourForm.firstTextField.value='';return false; on your page. replace nameOfYourForm and firstTextField with the appropriate names. I think you'll start to see where this is going. It's not hard, and there isn't a need for server side processing, unless there is, well, a need for server side processing. Is there? You haven't mentioned any. -Dave -Original Message- From: Gus Delgado [mailto:[EMAIL PROTECTED]] Sent: Monday, February 10, 2003 3:14 PM To: Struts Users Mailing List Subject: Re: Reset button. isReset() who's method is that, action, form? I can't seem to find it. -Gus Jacky Kimmel wrote: if (isReset(httpServletRequest)) { return actionMapping.findForward(Constants.D_RESET); } As you can see, I had a constants class that I refer to. Also, in the struts-config.xml I have mapped this forward back to the original jsp. I put this snippet of code in the beginning of each action class I have. Gus Delgado [EMAIL PROTECTED] wrote:how do I check for the reset in the Action? Jacky Kimmel wrote: It sounds like your action does not check to see if the reset was clicked or not. What I have done is do this check at the beginning of all my action classes. If the reset has been selected then the action is redirected to the empty jsp. It sounds like your action mapping may also not be corrected in your config file. Gus Delgado wrote:I have created a JSP with a Submit and Reset button both using the and tags. When I first render the page the reset works just fine, but if I hit the submit button and the page gets render again, I try to hit the reset and the form does not get clear anymore, the reset button does not work anymore, any ideas of why this is happening? any ways to fix it? thank you -Gus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reset button.
no, not really, I'll give it a try thank you! -gus Durham David Cntr 805CSS/SCBE wrote: Gus, try going back a few posts to the javascript stuff. I think it's more in line with your original question. As a test try putting: input type=reset onClick=nameOfYourForm.firstTextField.value='';return false; on your page. replace nameOfYourForm and firstTextField with the appropriate names. I think you'll start to see where this is going. It's not hard, and there isn't a need for server side processing, unless there is, well, a need for server side processing. Is there? You haven't mentioned any. -Dave -Original Message- From: Gus Delgado [mailto:[EMAIL PROTECTED]] Sent: Monday, February 10, 2003 3:14 PM To: Struts Users Mailing List Subject: Re: Reset button. isReset() who's method is that, action, form? I can't seem to find it. -Gus Jacky Kimmel wrote: if (isReset(httpServletRequest)) { return actionMapping.findForward(Constants.D_RESET); } As you can see, I had a constants class that I refer to. Also, in the struts-config.xml I have mapped this forward back to the original jsp. I put this snippet of code in the beginning of each action class I have. Gus Delgado [EMAIL PROTECTED] wrote:how do I check for the reset in the Action? Jacky Kimmel wrote: It sounds like your action does not check to see if the reset was clicked or not. What I have done is do this check at the beginning of all my action classes. If the reset has been selected then the action is redirected to the empty jsp. It sounds like your action mapping may also not be corrected in your config file. Gus Delgado wrote:I have created a JSP with a Submit and Reset button both using the and tags. When I first render the page the reset works just fine, but if I hit the submit button and the page gets render again, I try to hit the reset and the form does not get clear anymore, the reset button does not work anymore, any ideas of why this is happening? any ways to fix it? thank you -Gus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] . - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Reset button does not invoke the FormBean's reset()
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 casesbut 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
RE: Reset button does not invoke the FormBean's reset()
Hi JML, Thanks for your response. I think using html:submit value=reset property=reset/ will post the form and take me to the next page or the same if I have that mapping in struts-config.xml. But, is there a way to reset the radio buttons to unselected values without server round trip using some javascript . Thanks Priyank -Original Message- From: Leblon Jean-marc [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 01, 2002 4:14 AM To: Struts Users Mailing List Subject: RE: Reset button does not invoke the FormBean's reset() 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 casesbut 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
RE: Reset button does not invoke the FormBean's reset()
sorry no idea, have i had a solution to my problem, I didnt look further :) JML [EMAIL PROTECTED] -Original Message- From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]] Sent: jeudi 1 août 2002 14:45 To: 'Struts Users Mailing List' Subject: RE: Reset button does not invoke the FormBean's reset() Hi JML, Thanks for your response. I think using html:submit value=reset property=reset/ will post the form and take me to the next page or the same if I have that mapping in struts-config.xml. But, is there a way to reset the radio buttons to unselected values without server round trip using some javascript . Thanks Priyank -Original Message- From: Leblon Jean-marc [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 01, 2002 4:14 AM To: Struts Users Mailing List Subject: RE: Reset button does not invoke the FormBean's reset() 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 casesbut 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
RE: Reset button does not invoke the FormBean's reset()
Yes, use the reset button... html:reset value=Reset 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: Thursday, August 01, 2002 8:45 AM To: 'Struts Users Mailing List' Subject: RE: Reset button does not invoke the FormBean's reset() Hi JML, Thanks for your response. I think using html:submit value=reset property=reset/ will post the form and take me to the next page or the same if I have that mapping in struts-config.xml. But, is there a way to reset the radio buttons to unselected values without server round trip using some javascript . Thanks Priyank snip/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Reset button does not invoke the FormBean's reset()
Hey I am using the reset button and it's not working . Try to be serious on the mailing lists , it's not your personal , alright.If you have some real solution please let me know. Thanks Priyank -Original Message- From: James Mitchell [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 01, 2002 10:46 AM To: Struts Users Mailing List Subject: RE: Reset button does not invoke the FormBean's reset() Yes, use the reset button... html:reset value=Reset 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: Thursday, August 01, 2002 8:45 AM To: 'Struts Users Mailing List' Subject: RE: Reset button does not invoke the FormBean's reset() Hi JML, Thanks for your response. I think using html:submit value=reset property=reset/ will post the form and take me to the next page or the same if I have that mapping in struts-config.xml. But, is there a way to reset the radio buttons to unselected values without server round trip using some javascript . Thanks Priyank snip/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Reset button does not invoke the FormBean's reset()
I'm trying to help you, but I'm not understanding what problems you are having. Please describe your use case further. Example: Use Case: Complete Personal Information #1. The user fills out form. Form: Textbox (firstname): - Max=10 chars - Required=lowercase Textbox (lastname): - Max=10 chars - Required=lowercase Radio Button Choice (age-range) - values coming from application scope bean (mychoices) - Choices are (Iteration 1): Key Value 1 0 to 21 2 22 to 40 3 41 to 60 4 over 60 Action choices: Submit - form is submitted, go to #2 Cancel - form is cancelled, go to main menu Reset - form is reset (this is an html reset) Clear - form is cleared of all values #2 When submitted, should save to database Known Exceptions: a. Validation errors - (reference validation table) b. Connection errors - (same as above) c. blah, blah, blah #3 Re-Display information (as it was saved) Action choices: a. user must use top level navigation to continue b. User hits back button - (this behavior is disallowed, and enforced with form-based token validation) Now, expecting functionality from anything after the user hits the back button should not be allowed, but as I mentioned in a prior emailif you do this... myform.jsp - /doForm.do - myresults.jsp ...then if the user hits the back button, if (and only IF) the form did NOT have radios selected, the radios should clear. **THIS IS IMPORTANT** Given the same scenario as above, if there are validation errors and the user is return to the 'myform.jsp' hitting the reset button ***WILL NOT*** reset the fields to what they were before the user hit submit. Now, if the user hits the back button right now, and the hit the reset button, then yes, it will do as I said above. I hope this helps you, if not, then please provide us with more to go on. 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: Thursday, August 01, 2002 10:52 AM To: 'Struts Users Mailing List' Subject: RE: Reset button does not invoke the FormBean's reset() Hey I am using the reset button and it's not working . Try to be serious on the mailing lists , it's not your personal , alright.If you have some real solution please let me know. Thanks Priyank -Original Message- From: James Mitchell [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 01, 2002 10:46 AM To: Struts Users Mailing List Subject: RE: Reset button does not invoke the FormBean's reset() Yes, use the reset button... html:reset value=Reset 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: Thursday, August 01, 2002 8:45 AM To: 'Struts Users Mailing List' Subject: RE: Reset button does not invoke the FormBean's reset() Hi JML, Thanks for your response. I think using html:submit value=reset property=reset/ will post the form and take me to the next page or the same if I have that mapping in struts-config.xml. But, is there a way to reset the radio buttons to unselected values without server round trip using some javascript . Thanks Priyank snip/ -- 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]
RE: Reset button does not invoke the FormBean's reset()
Hey, This explanation is awesome. ...then if the user hits the back button, if (and only IF) the form did NOT have radios selected, the radios should clear. The above scenario in my case is : ...then if the user hits the back button, the form did HAVE radios selected, the radios should clear. How to do that ? Thanks Priyank -Original Message- From: James Mitchell [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 01, 2002 11:20 AM To: Struts Users Mailing List Subject: RE: Reset button does not invoke the FormBean's reset() I'm trying to help you, but I'm not understanding what problems you are having. Please describe your use case further. Example: Use Case: Complete Personal Information #1. The user fills out form. Form: Textbox (firstname): - Max=10 chars - Required=lowercase Textbox (lastname): - Max=10 chars - Required=lowercase Radio Button Choice (age-range) - values coming from application scope bean (mychoices) - Choices are (Iteration 1): Key Value 1 0 to 21 2 22 to 40 3 41 to 60 4 over 60 Action choices: Submit - form is submitted, go to #2 Cancel - form is cancelled, go to main menu Reset - form is reset (this is an html reset) Clear - form is cleared of all values #2 When submitted, should save to database Known Exceptions: a. Validation errors - (reference validation table) b. Connection errors - (same as above) c. blah, blah, blah #3 Re-Display information (as it was saved) Action choices: a. user must use top level navigation to continue b. User hits back button - (this behavior is disallowed, and enforced with form-based token validation) Now, expecting functionality from anything after the user hits the back button should not be allowed, but as I mentioned in a prior emailif you do this... myform.jsp - /doForm.do - myresults.jsp ...then if the user hits the back button, if (and only IF) the form did NOT have radios selected, the radios should clear. **THIS IS IMPORTANT** Given the same scenario as above, if there are validation errors and the user is return to the 'myform.jsp' hitting the reset button ***WILL NOT*** reset the fields to what they were before the user hit submit. Now, if the user hits the back button right now, and the hit the reset button, then yes, it will do as I said above. I hope this helps you, if not, then please provide us with more to go on. 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: Thursday, August 01, 2002 10:52 AM To: 'Struts Users Mailing List' Subject: RE: Reset button does not invoke the FormBean's reset() Hey I am using the reset button and it's not working . Try to be serious on the mailing lists , it's not your personal , alright.If you have some real solution please let me know. Thanks Priyank -Original Message- From: James Mitchell [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 01, 2002 10:46 AM To: Struts Users Mailing List Subject: RE: Reset button does not invoke the FormBean's reset() Yes, use the reset button... html:reset value=Reset 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: Thursday, August 01, 2002 8:45 AM To: 'Struts Users Mailing List' Subject: RE: Reset button does not invoke the FormBean's reset() Hi JML, Thanks for your response. I think using html:submit value=reset property=reset/ will post the form and take me to the next page or the same if I have that mapping in struts-config.xml. But, is there a way to reset the radio buttons to unselected values without server round trip using some javascript . Thanks Priyank snip/ -- 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]
RE: Reset button does not invoke the FormBean's reset()
Ok, then what are wanting is 'Clear' functionality, not 'Reset' functionality. You need to decide which form elements you want cleared, and just throw in the script. Here's some sample code for ya: form name=frm action=? method=GET INPUT type=radio name=rdo value=test1test1br INPUT type=radio name=rdo value=test2 checkedtest2br INPUT type=radio name=rdo value=test3test3br INPUT type=submit value=Submit name=submit INPUT type=reset value=Reset id=reset1 name=reset1 input type=button value=Clear Form onclick=resetForm() /form SCRIPT LANGUAGE=javascript !-- function resetForm(){ dml=document.forms[0]; len = dml.elements.length; var i=0; for( i = 0 ; i len ; i++) { if (dml.elements[i].type=='radio') { dml.elements[i].checked=false; } } } //-- /SCRIPT If you put this in a simple htm file and open it in a browser, you'll notice a couple of things: -there are 3 radio buttons (the 2nd one is selected by default) -there are 3 choices to make (submit, reset, and clear) -by having action=? as the action in the form, if you hit submit, the form submits to itself. (I also posted with GET so you can see the value in the address bar) 1. Hit the submit button. The form just redisplays with a new URL. 2. Now hit the reset button. Nothing happens. 3. Choose a different radio button and hit Reset. It just goes back to the 2nd one. 4. Choose a different radio button and hit Clear. I think that's what you want. Let me know if that's not what you are trying to do. 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: Thursday, August 01, 2002 11:29 AM To: 'Struts Users Mailing List' Subject: RE: Reset button does not invoke the FormBean's reset() Hey, This explanation is awesome. ...then if the user hits the back button, if (and only IF) the form did NOT have radios selected, the radios should clear. The above scenario in my case is : ...then if the user hits the back button, the form did HAVE radios selected, the radios should clear. How to do that ? Thanks Priyank -Original Message- From: James Mitchell [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 01, 2002 11:20 AM To: Struts Users Mailing List Subject: RE: Reset button does not invoke the FormBean's reset() I'm trying to help you, but I'm not understanding what problems you are having. Please describe your use case further. Example: Use Case: Complete Personal Information #1. The user fills out form. Form: Textbox (firstname): - Max=10 chars - Required=lowercase Textbox (lastname): - Max=10 chars - Required=lowercase Radio Button Choice (age-range) - values coming from application scope bean (mychoices) - Choices are (Iteration 1): Key Value 1 0 to 21 2 22 to 40 3 41 to 60 4 over 60 Action choices: Submit - form is submitted, go to #2 Cancel - form is cancelled, go to main menu Reset - form is reset (this is an html reset) Clear - form is cleared of all values #2 When submitted, should save to database Known Exceptions: a. Validation errors - (reference validation table) b. Connection errors - (same as above) c. blah, blah, blah #3 Re-Display information (as it was saved) Action choices: a. user must use top level navigation to continue b. User hits back button - (this behavior is disallowed, and enforced with form-based token validation) Now, expecting functionality from anything after the user hits the back button should not be allowed, but as I mentioned in a prior emailif you do this... myform.jsp - /doForm.do - myresults.jsp ...then if the user hits the back button, if (and only IF) the form did NOT have radios selected, the radios should clear. **THIS IS IMPORTANT** Given the same scenario as above, if there are validation errors and the user is return to the 'myform.jsp' hitting the reset button ***WILL NOT*** reset the fields to what they were before the user hit submit. Now, if the user hits the back button right now, and the hit the reset button, then yes, it will do as I said above. I hope this helps you, if not, then please provide us with more to go on. 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: Thursday, August 01, 2002 10:52 AM To: 'Struts Users Mailing List' Subject: RE: Reset button
RE: Reset button does not invoke the FormBean's reset()
Hey, I don't know if anyone cares, but what I usually do is put a clear method in most of my ActionForms. In my JSP, I have a link to clear the form by simply going to an action and sending a parameter telling it to clear the ActionForm. It's a very nice little thing, it avoids JavaScript and is much easier to use. It's also much more reusable if I want to be able to clear the form from a couple different pages, because I just have to throw in a link instead of blocks of code. ~ Keith http://www.buffalo.edu/~kkamholz -Original Message- From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 01, 2002 1:24 PM To: 'Struts Users Mailing List' Subject: RE: Reset button does not invoke the FormBean's reset() Thanks James. I greatly appreciate your help. -Original Message- From: James Mitchell [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 01, 2002 12:10 PM To: Struts Users Mailing List Subject: RE: Reset button does not invoke the FormBean's reset() Ok, then what are wanting is 'Clear' functionality, not 'Reset' functionality. You need to decide which form elements you want cleared, and just throw in the script. Here's some sample code for ya: form name=frm action=? method=GET INPUT type=radio name=rdo value=test1test1br INPUT type=radio name=rdo value=test2 checkedtest2br INPUT type=radio name=rdo value=test3test3br INPUT type=submit value=Submit name=submit INPUT type=reset value=Reset id=reset1 name=reset1 input type=button value=Clear Form onclick=resetForm() /form SCRIPT LANGUAGE=javascript !-- function resetForm(){ dml=document.forms[0]; len = dml.elements.length; var i=0; for( i = 0 ; i len ; i++) { if (dml.elements[i].type=='radio') { dml.elements[i].checked=false; } } } //-- /SCRIPT If you put this in a simple htm file and open it in a browser, you'll notice a couple of things: -there are 3 radio buttons (the 2nd one is selected by default) -there are 3 choices to make (submit, reset, and clear) -by having action=? as the action in the form, if you hit submit, the form submits to itself. (I also posted with GET so you can see the value in the address bar) 1. Hit the submit button. The form just redisplays with a new URL. 2. Now hit the reset button. Nothing happens. 3. Choose a different radio button and hit Reset. It just goes back to the 2nd one. 4. Choose a different radio button and hit Clear. I think that's what you want. Let me know if that's not what you are trying to do. 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: Thursday, August 01, 2002 11:29 AM To: 'Struts Users Mailing List' Subject: RE: Reset button does not invoke the FormBean's reset() Hey, This explanation is awesome. ...then if the user hits the back button, if (and only IF) the form did NOT have radios selected, the radios should clear. The above scenario in my case is : ...then if the user hits the back button, the form did HAVE radios selected, the radios should clear. How to do that ? Thanks Priyank -Original Message- From: James Mitchell [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 01, 2002 11:20 AM To: Struts Users Mailing List Subject: RE: Reset button does not invoke the FormBean's reset() I'm trying to help you, but I'm not understanding what problems you are having. Please describe your use case further. Example: Use Case: Complete Personal Information #1. The user fills out form. Form: Textbox (firstname): - Max=10 chars - Required=lowercase Textbox (lastname): - Max=10 chars - Required=lowercase Radio Button Choice (age-range) - values coming from application scope bean (mychoices) - Choices are (Iteration 1): Key Value 1 0 to 21 2 22 to 40 3 41 to 60 4 over 60 Action choices: Submit - form is submitted, go to #2 Cancel - form is cancelled, go to main menu Reset - form is reset (this is an html reset) Clear - form is cleared of all values #2 When submitted, should save to database Known Exceptions: a. Validation errors - (reference validation table) b. Connection errors - (same as above) c. blah, blah, blah #3 Re-Display information (as it was saved) Action choices: a. user must use top level navigation to continue b. User hits back button - (this behavior is disallowed, and enforced with form-based token validation) Now, expecting functionality from anything after the user hits the back button should
RE: Reset button does not invoke the FormBean's reset()
That's a good idea. I too wanted to avoid dirty javascript :) Thanks Priyank -Original Message- From: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 01, 2002 1:34 PM To: 'Struts Users Mailing List' Subject: RE: Reset button does not invoke the FormBean's reset() Hey, I don't know if anyone cares, but what I usually do is put a clear method in most of my ActionForms. In my JSP, I have a link to clear the form by simply going to an action and sending a parameter telling it to clear the ActionForm. It's a very nice little thing, it avoids JavaScript and is much easier to use. It's also much more reusable if I want to be able to clear the form from a couple different pages, because I just have to throw in a link instead of blocks of code. ~ Keith http://www.buffalo.edu/~kkamholz -Original Message- From: Gupta, Priyank x57787 [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 01, 2002 1:24 PM To: 'Struts Users Mailing List' Subject: RE: Reset button does not invoke the FormBean's reset() Thanks James. I greatly appreciate your help. -Original Message- From: James Mitchell [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 01, 2002 12:10 PM To: Struts Users Mailing List Subject: RE: Reset button does not invoke the FormBean's reset() Ok, then what are wanting is 'Clear' functionality, not 'Reset' functionality. You need to decide which form elements you want cleared, and just throw in the script. Here's some sample code for ya: form name=frm action=? method=GET INPUT type=radio name=rdo value=test1test1br INPUT type=radio name=rdo value=test2 checkedtest2br INPUT type=radio name=rdo value=test3test3br INPUT type=submit value=Submit name=submit INPUT type=reset value=Reset id=reset1 name=reset1 input type=button value=Clear Form onclick=resetForm() /form SCRIPT LANGUAGE=javascript !-- function resetForm(){ dml=document.forms[0]; len = dml.elements.length; var i=0; for( i = 0 ; i len ; i++) { if (dml.elements[i].type=='radio') { dml.elements[i].checked=false; } } } //-- /SCRIPT If you put this in a simple htm file and open it in a browser, you'll notice a couple of things: -there are 3 radio buttons (the 2nd one is selected by default) -there are 3 choices to make (submit, reset, and clear) -by having action=? as the action in the form, if you hit submit, the form submits to itself. (I also posted with GET so you can see the value in the address bar) 1. Hit the submit button. The form just redisplays with a new URL. 2. Now hit the reset button. Nothing happens. 3. Choose a different radio button and hit Reset. It just goes back to the 2nd one. 4. Choose a different radio button and hit Clear. I think that's what you want. Let me know if that's not what you are trying to do. 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: Thursday, August 01, 2002 11:29 AM To: 'Struts Users Mailing List' Subject: RE: Reset button does not invoke the FormBean's reset() Hey, This explanation is awesome. ...then if the user hits the back button, if (and only IF) the form did NOT have radios selected, the radios should clear. The above scenario in my case is : ...then if the user hits the back button, the form did HAVE radios selected, the radios should clear. How to do that ? Thanks Priyank -Original Message- From: James Mitchell [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 01, 2002 11:20 AM To: Struts Users Mailing List Subject: RE: Reset button does not invoke the FormBean's reset() I'm trying to help you, but I'm not understanding what problems you are having. Please describe your use case further. Example: Use Case: Complete Personal Information #1. The user fills out form. Form: Textbox (firstname): - Max=10 chars - Required=lowercase Textbox (lastname): - Max=10 chars - Required=lowercase Radio Button Choice (age-range) - values coming from application scope bean (mychoices) - Choices are (Iteration 1): Key Value 1 0 to 21 2 22 to 40 3 41 to 60 4 over 60 Action choices: Submit - form is submitted, go to #2 Cancel - form is cancelled, go to main menu Reset - form is reset (this is an html reset) Clear - form is cleared of all values #2 When submitted, should save to database Known Exceptions: a. Validation errors - (reference validation table) b. Connection errors - (same as above) c. blah, blah, blah #3 Re-Display information (as it was saved) Action choices: a. user must use
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]
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]
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]
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]
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 casesbut 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]
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 casesbut 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]