RE: Disable validator framework
Hi, I'm bringing up an old topic here regarding multipage form validation. In the example shown in the previous message, am I suppose to set validate="true" in struts-config? If yes, what's the value of the 'input' attribute, since there are multiple pages? Or should I set validate to false and call validate within my action class? Rgds, Patrick. -Original Message- From: Andriy Ruzhevych [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 7:28 PM To: Struts Users Mailing List Subject: RE: Disable validator framework the first you must add the page attribute in your form bean and change validation.xml like in this case when page=1 then only calculationType validate, when page=2 then calculationType and isDecret validate. when page=n (fields from page attr page=0..n validate) -Original Message- From: Patrick Cheng [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 12:49 PM To: Struts Users Mailing List Subject: RE: Disable validator framework If you want to do validation conditionally, you can disable validation in struts-config, and call 'form.validate' explicitly in the Action class.(base on your condition) About the 'page' attribute, what I don't understand is, how does struts know which fields are in page 1, which fields are in page 2,3,4..., in order to do the validation for the current+previous pages only? Rgds, Patrick. -Original Message- From: Andriy Ruzhevych [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 4:50 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: Disable validator framework You can try to use the page attribute of the field element. "Only fields with a page attribute value that is equal to or less than the value of the page property on the form JavaBean are processed. This is useful when using a "wizard" approach to completing a large form, to ensure that a page is not skipped" -Original Message- From: Mohan Radhakrishnan [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 8:34 AM To: 'Struts Users Mailing List' Subject: Disable validator framework Hi We are using dispatch action and validator framework. There is a popup action associated with one button on the form. When the user clicks on this a particular method in the action is called but I don't want to validate the ActionForm because the main form is not submitted. There are other buttons that submit the form and I need a selective validator framework. I know that it is possible if I were to write my own validate() method by checking a particular value in the form. Can I disable the validator similarly ? If this is not possible then I have to abandon the validator. Appreciate ideas. Mohan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ NOD32 1.596 (20040109) Information __ This message was checked by NOD32 antivirus system. http://www.nod32.com - 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] __ NOD32 1.596 (20040109) Information __ This message was checked by NOD32 antivirus system. http://www.nod32.com - 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: Disable validator framework
There are a 1/2 dozen ways to do this at least. Here are four of them. 1) Create an additional action-mapping with validate=false, submit to that mapping. (someone else stated this one) 2) Override the validate method of the form look for an attribute and selective call super class validate method. (you stated this one) 3) Use a cancel button. The request dispatcher checks to see if the cancel button is checked and wont validate the form or populate the form if the cancel button is checked. This might be a problem if you want the form populated. (someone else stated this... this could be a problem if you want the form populated as the cancel button is checked before form population) 4) Subclass the request processor check for a special atrribute being set by your form (name of the button). The override the following method (my suggestion): protected boolean processValidate(HttpServletRequest request, HttpServletResponse response, ActionForm form, ActionMapping mapping) ... -Original Message- From: Mohan Radhakrishnan [mailto:[EMAIL PROTECTED] Sent: Thursday, January 15, 2004 11:34 PM To: 'Struts Users Mailing List' Subject: Disable validator framework Hi We are using dispatch action and validator framework. There is a popup action associated with one button on the form. When the user clicks on this a particular method in the action is called but I don't want to validate the ActionForm because the main form is not submitted. There are other buttons that submit the form and I need a selective validator framework. I know that it is possible if I were to write my own validate() method by checking a particular value in the form. Can I disable the validator similarly ? If this is not possible then I have to abandon the validator. Appreciate ideas. Mohan - 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: Disable validator framework
the first you must add the page attribute in your form bean and change validation.xml like in this case when page=1 then only calculationType validate, when page=2 then calculationType and isDecret validate. when page=n (fields from page attr page=0..n validate) -Original Message- From: Patrick Cheng [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 12:49 PM To: Struts Users Mailing List Subject: RE: Disable validator framework If you want to do validation conditionally, you can disable validation in struts-config, and call 'form.validate' explicitly in the Action class.(base on your condition) About the 'page' attribute, what I don't understand is, how does struts know which fields are in page 1, which fields are in page 2,3,4..., in order to do the validation for the current+previous pages only? Rgds, Patrick. -Original Message- From: Andriy Ruzhevych [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 4:50 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: Disable validator framework You can try to use the page attribute of the field element. "Only fields with a page attribute value that is equal to or less than the value of the page property on the form JavaBean are processed. This is useful when using a "wizard" approach to completing a large form, to ensure that a page is not skipped" -Original Message- From: Mohan Radhakrishnan [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 8:34 AM To: 'Struts Users Mailing List' Subject: Disable validator framework Hi We are using dispatch action and validator framework. There is a popup action associated with one button on the form. When the user clicks on this a particular method in the action is called but I don't want to validate the ActionForm because the main form is not submitted. There are other buttons that submit the form and I need a selective validator framework. I know that it is possible if I were to write my own validate() method by checking a particular value in the form. Can I disable the validator similarly ? If this is not possible then I have to abandon the validator. Appreciate ideas. Mohan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ NOD32 1.596 (20040109) Information __ This message was checked by NOD32 antivirus system. http://www.nod32.com - 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] __ NOD32 1.596 (20040109) Information __ This message was checked by NOD32 antivirus system. http://www.nod32.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Disable validator framework
If you want to do validation conditionally, you can disable validation in struts-config, and call 'form.validate' explicitly in the Action class.(base on your condition) About the 'page' attribute, what I don't understand is, how does struts know which fields are in page 1, which fields are in page 2,3,4..., in order to do the validation for the current+previous pages only? Rgds, Patrick. -Original Message- From: Andriy Ruzhevych [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 4:50 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: Disable validator framework You can try to use the page attribute of the field element. "Only fields with a page attribute value that is equal to or less than the value of the page property on the form JavaBean are processed. This is useful when using a "wizard" approach to completing a large form, to ensure that a page is not skipped" -Original Message- From: Mohan Radhakrishnan [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 8:34 AM To: 'Struts Users Mailing List' Subject: Disable validator framework Hi We are using dispatch action and validator framework. There is a popup action associated with one button on the form. When the user clicks on this a particular method in the action is called but I don't want to validate the ActionForm because the main form is not submitted. There are other buttons that submit the form and I need a selective validator framework. I know that it is possible if I were to write my own validate() method by checking a particular value in the form. Can I disable the validator similarly ? If this is not possible then I have to abandon the validator. Appreciate ideas. Mohan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ NOD32 1.596 (20040109) Information __ This message was checked by NOD32 antivirus system. http://www.nod32.com - 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: Disable validator framework
you could rewrite it like this Task -Original Message- From: Mohan Radhakrishnan [mailto:[EMAIL PROTECTED] Sent: 16 January 2004 09:28 To: 'Struts Users Mailing List' Subject: RE: Disable validator framework Hi, What if it is not a 'submit' ? Mine is like this Thanks Mohan -Original Message- From: Hunt, Steve [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 2:05 PM To: 'Struts Users Mailing List' Subject: RE: Disable validator framework Mohan, If you use the html:cancel type of button rather than html:submit the validation framework is not called. If you are using client side javascript validation through the framework you can disable validation of a button by setting the parameter bCancel=true like this; Regards Steve -Original Message- From: Mohan Radhakrishnan [mailto:[EMAIL PROTECTED] Sent: 16 January 2004 06:34 To: 'Struts Users Mailing List' Subject: Disable validator framework Hi We are using dispatch action and validator framework. There is a popup action associated with one button on the form. When the user clicks on this a particular method in the action is called but I don't want to validate the ActionForm because the main form is not submitted. There are other buttons that submit the form and I need a selective validator framework. I know that it is possible if I were to write my own validate() method by checking a particular value in the form. Can I disable the validator similarly ? If this is not possible then I have to abandon the validator. Appreciate ideas. Mohan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] === This message contains information that may be privileged or confidential and is the property of the Cap Gemini Ernst & Young Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorised to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. === - 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: Disable validator framework
Hi, What if it is not a 'submit' ? Mine is like this Thanks Mohan -Original Message- From: Hunt, Steve [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 2:05 PM To: 'Struts Users Mailing List' Subject: RE: Disable validator framework Mohan, If you use the html:cancel type of button rather than html:submit the validation framework is not called. If you are using client side javascript validation through the framework you can disable validation of a button by setting the parameter bCancel=true like this; Regards Steve -Original Message- From: Mohan Radhakrishnan [mailto:[EMAIL PROTECTED] Sent: 16 January 2004 06:34 To: 'Struts Users Mailing List' Subject: Disable validator framework Hi We are using dispatch action and validator framework. There is a popup action associated with one button on the form. When the user clicks on this a particular method in the action is called but I don't want to validate the ActionForm because the main form is not submitted. There are other buttons that submit the form and I need a selective validator framework. I know that it is possible if I were to write my own validate() method by checking a particular value in the form. Can I disable the validator similarly ? If this is not possible then I have to abandon the validator. Appreciate ideas. Mohan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] === This message contains information that may be privileged or confidential and is the property of the Cap Gemini Ernst & Young Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorised to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. === - 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: Disable validator framework
You can try to use the page attribute of the field element. "Only fields with a page attribute value that is equal to or less than the value of the page property on the form JavaBean are processed. This is useful when using a "wizard" approach to completing a large form, to ensure that a page is not skipped" -Original Message- From: Mohan Radhakrishnan [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 8:34 AM To: 'Struts Users Mailing List' Subject: Disable validator framework Hi We are using dispatch action and validator framework. There is a popup action associated with one button on the form. When the user clicks on this a particular method in the action is called but I don't want to validate the ActionForm because the main form is not submitted. There are other buttons that submit the form and I need a selective validator framework. I know that it is possible if I were to write my own validate() method by checking a particular value in the form. Can I disable the validator similarly ? If this is not possible then I have to abandon the validator. Appreciate ideas. Mohan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ NOD32 1.596 (20040109) Information __ This message was checked by NOD32 antivirus system. http://www.nod32.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Disable validator framework
How tough will it be to modify the code so as to have individual action for each button.Well, if you can then thats the best way.Also will help in workflow (not sure whether thats part of the project requirement). Rahul -Original Message- From: Hunt, Steve [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 2:05 PM To: 'Struts Users Mailing List' Subject: RE: Disable validator framework Mohan, If you use the html:cancel type of button rather than html:submit the validation framework is not called. If you are using client side javascript validation through the framework you can disable validation of a button by setting the parameter bCancel=true like this; Regards Steve -Original Message- From: Mohan Radhakrishnan [mailto:[EMAIL PROTECTED] Sent: 16 January 2004 06:34 To: 'Struts Users Mailing List' Subject: Disable validator framework Hi We are using dispatch action and validator framework. There is a popup action associated with one button on the form. When the user clicks on this a particular method in the action is called but I don't want to validate the ActionForm because the main form is not submitted. There are other buttons that submit the form and I need a selective validator framework. I know that it is possible if I were to write my own validate() method by checking a particular value in the form. Can I disable the validator similarly ? If this is not possible then I have to abandon the validator. Appreciate ideas. Mohan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] === This message contains information that may be privileged or confidential and is the property of the Cap Gemini Ernst & Young Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorised to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. === - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Disable validator framework
Mohan, If you use the html:cancel type of button rather than html:submit the validation framework is not called. If you are using client side javascript validation through the framework you can disable validation of a button by setting the parameter bCancel=true like this; Regards Steve -Original Message- From: Mohan Radhakrishnan [mailto:[EMAIL PROTECTED] Sent: 16 January 2004 06:34 To: 'Struts Users Mailing List' Subject: Disable validator framework Hi We are using dispatch action and validator framework. There is a popup action associated with one button on the form. When the user clicks on this a particular method in the action is called but I don't want to validate the ActionForm because the main form is not submitted. There are other buttons that submit the form and I need a selective validator framework. I know that it is possible if I were to write my own validate() method by checking a particular value in the form. Can I disable the validator similarly ? If this is not possible then I have to abandon the validator. Appreciate ideas. Mohan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] === This message contains information that may be privileged or confidential and is the property of the Cap Gemini Ernst & Young Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorised to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. === - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]