Srikanth Goud wrote:
Hi,
   Still i don't have any idea for this.
   Could you pls provide a solution

Complex validations are generally easier to handle in an action's validate() method--it's *possible* to do via XML or annotations, but personally I find it a little unwieldy.

   But in the form there are Two Tables with some fields. And at a time
only one table will be on page depedning on the user selected option.
Written validations for all fields in the first table and second table.

so, if user selects his option than for only those fields validations
should fire.
But here the validations are firing for the first table and second table.
How should i stop the validations?

You'll have to have some mechanism for determining which form elements have been filled in. Depending on how you're switching between elements it may be easiest to do this via JavaScript, setting an additional hidden value indicating which group of elements the validation should pay attention to.

If only one set of forms is actually *submitted* then it can be as simple as checking for the presence of a required form parameter.

If there are shared form elements that require simplistic validation it's easy to use XML- or annotation-driven validation in addition to the custom validation by calling super.validate().

Dave

https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3211397


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to