Rick Reumann wrote:
Sony Thomas wrote the following on 1/13/2006 8:34 AM:
1. You can set the validate attribute to false in struts-config and
then in the action you can call the validate method.
inside the action
This is the approach I like to use:
http://www.learntechnology.net/validate-manually.do (bottom of article
shows technique),
but, if you don't want to call validate manually from your Action (which
again I recommend:), you could just use an instance of
ValidatorActionForm...
http://struts.apache.org/struts-taglib/dev_validator.html
"An alternative approach is to use the action mapping path attribute. In
this case, you extend the ValidatorActionForm instead of the
ValidatorForm. The ValidatorActionForm uses the action element's path
attribute from the Struts configuration which should match the form
element's name attribute in the Validator configuration."
Yep, that'll get you the validation based on the action rather than the
form. To handle the requirement that you have two distinct sets of
validation for the same form/action [search validation and edit
validation], take a look at the validwhen validator rule [1].
An alternative, if you can use it in your application, would be to have
two forms on the page, one for the search and one for the edit. If you
can split your forms in two like that, validation will be a lot easier
to deal with.
HTH,
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]