Resetting checkboxes in a multipage form
Hello everybody, I'm trying to implement a multipage form, with at least one checkbox. To solve the problem with unchecked boxes not being submitted to the server, I implemented the reset() method to set my checkboxValue to false. However this solution does not work in a multipage form, as the reset() method is called for every page of my form, even the pages where my checkbox is not on. For ex. a 3 page form I check the box on page1, submit and go to page 2 -- everything works fine fill in page 2, submit and got to page3 -- not ok reset is called -- checkboxvalue back to false, and my bean is not repopulated with the correct value because my checkbox was not on page2. Does anybody know an elegant solution to this problem? Or am I forced to put a hidden parameter with the same name/value pair as my checkbox on the pages where my checkbox is not on. thx for your time, Nicolas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Resetting checkboxes in a multipage form
Hi, Do you use HTML tags or STRUTS tags for your checkboxes -Message d'origine- De : Nicolas Pottrain [mailto:[EMAIL PROTECTED] Envoyé : jeudi 3 avril 2003 10:45 À : '[EMAIL PROTECTED]' Objet : Resetting checkboxes in a multipage form Hello everybody, I'm trying to implement a multipage form, with at least one checkbox. To solve the problem with unchecked boxes not being submitted to the server, I implemented the reset() method to set my checkboxValue to false. However this solution does not work in a multipage form, as the reset() method is called for every page of my form, even the pages where my checkbox is not on. For ex. a 3 page form I check the box on page1, submit and go to page 2 -- everything works fine fill in page 2, submit and got to page3 -- not ok reset is called -- checkboxvalue back to false, and my bean is not repopulated with the correct value because my checkbox was not on page2. Does anybody know an elegant solution to this problem? Or am I forced to put a hidden parameter with the same name/value pair as my checkbox on the pages where my checkbox is not on. thx for your time, Nicolas - 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: Resetting checkboxes in a multipage form
I use struts tags, does it matter? html:checkbox property=foobar/html:checkbox -Original Message- From: ROMERO NAVARRO Guillermo [mailto:[EMAIL PROTECTED] Sent: Thursday, April 03, 2003 10:55 AM To: Struts Users Mailing List Subject: RE: Resetting checkboxes in a multipage form Hi, Do you use HTML tags or STRUTS tags for your checkboxes -Message d'origine- De : Nicolas Pottrain [mailto:[EMAIL PROTECTED] Envoyé : jeudi 3 avril 2003 10:45 À : '[EMAIL PROTECTED]' Objet : Resetting checkboxes in a multipage form Hello everybody, I'm trying to implement a multipage form, with at least one checkbox. To solve the problem with unchecked boxes not being submitted to the server, I implemented the reset() method to set my checkboxValue to false. However this solution does not work in a multipage form, as the reset() method is called for every page of my form, even the pages where my checkbox is not on. For ex. a 3 page form I check the box on page1, submit and go to page 2 -- everything works fine fill in page 2, submit and got to page3 -- not ok reset is called -- checkboxvalue back to false, and my bean is not repopulated with the correct value because my checkbox was not on page2. Does anybody know an elegant solution to this problem? Or am I forced to put a hidden parameter with the same name/value pair as my checkbox on the pages where my checkbox is not on. thx for your time, Nicolas - 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: Resetting checkboxes in a multipage form
We'd the same problem but we used HTML tags, i only want to know if the same problem arrive with Struts tags... For the solution we made like you, one hidden parameter :( -Message d'origine- De : Nicolas Pottrain [mailto:[EMAIL PROTECTED] Envoyé : jeudi 3 avril 2003 10:52 À : 'Struts Users Mailing List' Objet : RE: Resetting checkboxes in a multipage form I use struts tags, does it matter? html:checkbox property=foobar/html:checkbox -Original Message- From: ROMERO NAVARRO Guillermo [mailto:[EMAIL PROTECTED] Sent: Thursday, April 03, 2003 10:55 AM To: Struts Users Mailing List Subject: RE: Resetting checkboxes in a multipage form Hi, Do you use HTML tags or STRUTS tags for your checkboxes -Message d'origine- De : Nicolas Pottrain [mailto:[EMAIL PROTECTED] Envoyé : jeudi 3 avril 2003 10:45 À : '[EMAIL PROTECTED]' Objet : Resetting checkboxes in a multipage form Hello everybody, I'm trying to implement a multipage form, with at least one checkbox. To solve the problem with unchecked boxes not being submitted to the server, I implemented the reset() method to set my checkboxValue to false. However this solution does not work in a multipage form, as the reset() method is called for every page of my form, even the pages where my checkbox is not on. For ex. a 3 page form I check the box on page1, submit and go to page 2 -- everything works fine fill in page 2, submit and got to page3 -- not ok reset is called -- checkboxvalue back to false, and my bean is not repopulated with the correct value because my checkbox was not on page2. Does anybody know an elegant solution to this problem? Or am I forced to put a hidden parameter with the same name/value pair as my checkbox on the pages where my checkbox is not on. thx for your time, Nicolas - 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: Resetting checkboxes in a multipage form
You will need to put conditional logic in your reset() method so that it only resets checkbox values on the page that is being submitted and leaves checkbox values for other pages well alone. -Original Message- From: Nicolas Pottrain [mailto:[EMAIL PROTECTED] Sent: Thursday, 3 April 2003 16:45 To: '[EMAIL PROTECTED]' Subject: Resetting checkboxes in a multipage form Hello everybody, I'm trying to implement a multipage form, with at least one checkbox. To solve the problem with unchecked boxes not being submitted to the server, I implemented the reset() method to set my checkboxValue to false. However this solution does not work in a multipage form, as the reset() method is called for every page of my form, even the pages where my checkbox is not on. For ex. a 3 page form I check the box on page1, submit and go to page 2 -- everything works fine fill in page 2, submit and got to page3 -- not ok reset is called -- checkboxvalue back to false, and my bean is not repopulated with the correct value because my checkbox was not on page2. Does anybody know an elegant solution to this problem? Or am I forced to put a hidden parameter with the same name/value pair as my checkbox on the pages where my checkbox is not on. thx for your time, Nicolas - 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: Resetting checkboxes in a multipage form
Nicolas Pottrain írta: Does anybody know an elegant solution to this problem? Carry your input with the help of a hidden field. Tib - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Resetting checkboxes in a multipage form
ok, I will do it like this, thx for the info people -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Thursday, April 03, 2003 10:58 AM To: Struts Users Mailing List Subject: RE: Resetting checkboxes in a multipage form You will need to put conditional logic in your reset() method so that it only resets checkbox values on the page that is being submitted and leaves checkbox values for other pages well alone. -Original Message- From: Nicolas Pottrain [mailto:[EMAIL PROTECTED] Sent: Thursday, 3 April 2003 16:45 To: '[EMAIL PROTECTED]' Subject: Resetting checkboxes in a multipage form Hello everybody, I'm trying to implement a multipage form, with at least one checkbox. To solve the problem with unchecked boxes not being submitted to the server, I implemented the reset() method to set my checkboxValue to false. However this solution does not work in a multipage form, as the reset() method is called for every page of my form, even the pages where my checkbox is not on. For ex. a 3 page form I check the box on page1, submit and go to page 2 -- everything works fine fill in page 2, submit and got to page3 -- not ok reset is called -- checkboxvalue back to false, and my bean is not repopulated with the correct value because my checkbox was not on page2. Does anybody know an elegant solution to this problem? Or am I forced to put a hidden parameter with the same name/value pair as my checkbox on the pages where my checkbox is not on. thx for your time, Nicolas - 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: Resetting checkboxes in a multipage form
As you suggest, a solution is to use hidden fields on all pages for boolean (checkboxed) properties from other pages of the wizard-like form. As reset() gets the mapping I would suggest this : - extend ActionMapping to add a new property checkboxes - use this extended ActionMapping for your action, setting the new property with a comma separated list of boolean properties that this mapping should handle : action className=com.foo.WizardActionMapping name=wizardForm type=... set-property property=checkboxes value=checbox1, checkbox2 / forward .../ /action - in reset(), cast mapping to your extended mapping, and use it to get the list of boolean properties to reset. (this is example test, not tested and should not compile) resest(mapping, request) { if (mapping instanceOf WizardActionMapping) { WizardActionMapping wizardMapping = (WizardActionMapping) mapping; StringTokenizer tokenizer = new StringTokenizer(wizardMapping.getCheckBoxes(), ,); while (tokenizer.hasMoreToken()) { String checkbox = tokenizer.nextToken().trim(); // reset checkbox if (checbox1.equals(checkbox)) { checbox1 = false; } ... } } } If you find a good portable solution, you should redistribute it in Scaffold Struts tools (contribs), as I think it is a common problem. Hope it will help you. Nico. Hello everybody, I'm trying to implement a multipage form, with at least one checkbox. To solve the problem with unchecked boxes not being submitted to the server, I implemented the reset() method to set my checkboxValue to false. However this solution does not work in a multipage form, as the reset() method is called for every page of my form, even the pages where my checkbox is not on. For ex. a 3 page form I check the box on page1, submit and go to page 2 -- everything works fine fill in page 2, submit and got to page3 -- not ok reset is called -- checkboxvalue back to false, and my bean is not repopulated with the correct value because my checkbox was not on page2. Does anybody know an elegant solution to this problem? Or am I forced to put a hidden parameter with the same name/value pair as my checkbox on the pages where my checkbox is not on. thx for your time, Nicolas - 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: Resetting checkboxes in a multipage form
I know that it is not the exact subject of the message but I will wish to know if somebody implemented buttons check all/uncheck all on a struts page. So yes how? I already posted several messages on this subject but nobody answered. if somebody has a few minutes. My JSP page: logic:iterate name=myForm id=employees property=employees type=comm.Employeeoffset=offset length=length tr td bgcolor=#EBEBEB width=10% html:checkbox name=myForm property=selected/ /td /tr /logic:iterate table width=100% border=0 cellpadding=0 cellspacing=0 bgcolor=#ff tr td align=right valign=top width=10% html:button property=callId onclick=checkAll(this.myForm.selected) Checkall /html:button html:button property=callId onclick=uncheckAl(this.myForm.selected) Uncheckall /html:button /td tr /table script language=JavaScript function checkAll(field) { for (i = 0; i field.length; i++) field[i] = true ; } function uncheckAll(field) { for (i = 0; i field.length; i++) field[i] = false ; } /script My struts-config.xml form-bean name=myForm dynamic=true type=org.apache.struts.validator.DynaValidatorForm form-property name=selected type=java.lang.Boolean[] / /form-bean Thanks a lot in advance. As of February 12th, 2003 Thomson unifies its email addresses on a worldwide basis. Please note my new email address: [EMAIL PROTECTED] http://www.thomson.net/ Original Message- From: Nicolas Pottrain [mailto:[EMAIL PROTECTED] Sent: 03 April 2003 11:00 To: 'Struts Users Mailing List' Subject: RE: Resetting checkboxes in a multipage form ok, I will do it like this, thx for the info people -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Thursday, April 03, 2003 10:58 AM To: Struts Users Mailing List Subject: RE: Resetting checkboxes in a multipage form You will need to put conditional logic in your reset() method so that it only resets checkbox values on the page that is being submitted and leaves checkbox values for other pages well alone. -Original Message- From: Nicolas Pottrain [mailto:[EMAIL PROTECTED] Sent: Thursday, 3 April 2003 16:45 To: '[EMAIL PROTECTED]' Subject: Resetting checkboxes in a multipage form Hello everybody, I'm trying to implement a multipage form, with at least one checkbox. To solve the problem with unchecked boxes not being submitted to the server, I implemented the reset() method to set my checkboxValue to false. However this solution does not work in a multipage form, as the reset() method is called for every page of my form, even the pages where my checkbox is not on. For ex. a 3 page form I check the box on page1, submit and go to page 2 -- everything works fine fill in page 2, submit and got to page3 -- not ok reset is called -- checkboxvalue back to false, and my bean is not repopulated with the correct value because my checkbox was not on page2. Does anybody know an elegant solution to this problem? Or am I forced to put a hidden parameter with the same name/value pair as my checkbox on the pages where my checkbox is not on. thx for your time, Nicolas - 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: Resetting checkboxes in a multipage form
Heligon Sandra írta: I already posted several messages on this subject but nobody answered. Maybe your problem has nothing to do with struts. Try a javascript forum. Tib - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Resetting checkboxes in a multipage form
it is not that a simple problem of Javascript because the difficulty is to integrate the Javascript with the tags of struts html:button, html:checkbox. I cannot adapt the examples directly that I downloaded. this is why I address to the users of Struts As of February 12th, 2003 Thomson unifies its email addresses on a worldwide basis. Please note my new email address: [EMAIL PROTECTED] http://www.thomson.net/ Original Message- From: Gemes Tibor [mailto:[EMAIL PROTECTED] Sent: 03 April 2003 11:34 To: Struts Users Mailing List Subject: Re: Resetting checkboxes in a multipage form Heligon Sandra írta: I already posted several messages on this subject but nobody answered. Maybe your problem has nothing to do with struts. Try a javascript forum. Tib - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Resetting checkboxes in a multipage form
If your limiting users to browsers that support DOM properly, perhaps you could just recurse through the DOM looking for checkbox objects and changing their values? -Original Message- From: Heligon Sandra [mailto:[EMAIL PROTECTED] Sent: Thursday, 3 April 2003 17:52 To: 'Struts Users Mailing List' Subject: RE: Resetting checkboxes in a multipage form it is not that a simple problem of Javascript because the difficulty is to integrate the Javascript with the tags of struts html:button, html:checkbox. I cannot adapt the examples directly that I downloaded. this is why I address to the users of Struts As of February 12th, 2003 Thomson unifies its email addresses on a worldwide basis. Please note my new email address: [EMAIL PROTECTED] http://www.thomson.net/ Original Message- From: Gemes Tibor [mailto:[EMAIL PROTECTED] Sent: 03 April 2003 11:34 To: Struts Users Mailing List Subject: Re: Resetting checkboxes in a multipage form Heligon Sandra írta: I already posted several messages on this subject but nobody answered. Maybe your problem has nothing to do with struts. Try a javascript forum. Tib - 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: Resetting checkboxes in a multipage form
Sandra, Check out this thread in the archives ... http://marc.theaimsgroup.com/?l=struts-userm=101885294932468w=2 Hope it's somewhat helpful. Susan Bradeen On 04/03/2003 04:51:38 AM Heligon Sandra wrote: it is not that a simple problem of Javascript because the difficulty is to integrate the Javascript with the tags of struts html:button, html:checkbox. I cannot adapt the examples directly that I downloaded. this is why I address to the users of Struts As of February 12th, 2003 Thomson unifies its email addresses on a worldwide basis. Please note my new email address: [EMAIL PROTECTED] http://www.thomson.net/ Original Message- From: Gemes Tibor [mailto:[EMAIL PROTECTED] Sent: 03 April 2003 11:34 To: Struts Users Mailing List Subject: Re: Resetting checkboxes in a multipage form Heligon Sandra írta: I already posted several messages on this subject but nobody answered. Maybe your problem has nothing to do with struts. Try a javascript forum. Tib - 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]