From
https://springmodules.dev.java.net/docs/reference/0.8/html_single/#commons-validator
: 17.1.2. Use a dedicated validation-rules.xml

The file *validation-rules.xml* must contain Commons Validator elements
based on classes provided by the support of this framework in Spring
Modules.

For example, the configuration of the entities "required" and "requiredif"
must be now in the *validation-rules.xml* file.

<validator name="required"
         classname="org.springmodules.validation.commons.FieldChecks"
         method="validateRequired"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.springframework.validation.Errors"
         msg="errors.required">

 <javascript><![CDATA[
   (...)
 ]]></javascript>
</validator>

<validator name="requiredif"
          classname="org.springmodules.validation.commons.FieldChecks"
          method="validateRequiredIf"
          methodParams="java.lang.Object,
                        org.apache.commons.validator.ValidatorAction,
                        org.apache.commons.validator.Field,
                        org.springframework.validation.Errors,
                        org.apache.commons.validator.Validator"
         msg="errors.required">
</validator>

The validation sample of the distribution provides a complete *
validation-rules.xml* based on the classes of the support.

You must note that the support of *validwhen* is not provided at the moment
in the support. However, some codes are provides in JIRA. For more
informations, see the issues
MOD-38<http://opensource2.atlassian.com/projects/spring/browse/MOD-38>
and MOD-49 <http://opensource2.atlassian.com/projects/spring/browse/MOD-49>
.

On 7/10/07, Msarda <[EMAIL PROTECTED]> wrote:

When i am using validwhen,getting error as

[TryEngagementForm1] ERROR [main] AbstractBeanValidator.validate(66) |
Exception while validating object null
org.apache.commons.validator.ValidatorException: No ValidatorAction named
validwhen found for field typeOfReqSupportNo
        at
org.apache.commons.validator.Field.handleMissingAction(Field.java:867)
        at org.apache.commons.validator.Field.validate(Field.java:843)
        at org.apache.commons.validator.Form.validate(Form.java:290)
        at
org.apache.commons.validator.Validator.validate(Validator.java:354)
        at
org.springmodules.validation.commons.AbstractBeanValidator.validate(
AbstractBeanValidator.java:63)
        at
org.springframework.validation.ValidationUtils.invokeValidator(
ValidationUtils.java:63)
        at
org.springframework.web.servlet.mvc.BaseCommandController.bindAndValidate(
BaseCommandController.java:373)
        at

org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal
(AbstractFormController.java:248)
        at
org.springframework.web.servlet.mvc.AbstractController.handleRequest(
AbstractController.java:153)


i have done following in validation.xml

<field property="typeOfReqSupportNo" depends="validwhen">
                                        <arg position="0" key="
engagementform.typeOfReqSupportNo"/>
                                                <var>
                                                <var-name>test</var-name>
                                                <var-value>(typeofRequest
= 'Support')</var-value>
                                                 </var>
                                </field>

I don't have any <validator> in validation-rules.xml for validwhen.




Msarda wrote:
>
> Thank you very much :)
>
>
> mraible wrote:
>>
>> You may be able to use Commons Validator's ValidWhen:
>>
>> http://struts.apache.org/1.3.8/faqs/validator.html
>>
>> If that doesn't work, you can change your Controller's "validator"
>> property to a "validators" property and pass in a list of properties
>> (one for beanValidator and one for your custom Spring Validator that
>> performs additional logic).
>>
>> Matt
>>
>> On 7/10/07, Msarda <[EMAIL PROTECTED]> wrote:
>>>
>>> I am using spring framework (basic) with appfuse 2.0-m5 and maven
2.0.6
>>>
>>>
>>> mraible wrote:
>>> >
>>> > Which web framework (and version of AppFuse) are you using?
>>> >
>>> > On 7/10/07, Msarda <[EMAIL PROTECTED]> wrote:
>>> >>
>>> >> Hi all,
>>> >>
>>> >> I want to do validation for a field depending on the value of other
>>> field
>>> >> in
>>> >> validation.xml.
>>> >>
>>> >> I have two radio buttons,each one having a text box in front of
them
>>> to
>>> >> fill
>>> >> value if that particular radio button is selected.
>>> >> I just want to check that if the radio button is selected,there
>>> should be
>>> >> some value in textbox.
>>> >>
>>> >> I tried doing that in jsp only with alret() but the form is getting
>>> >> submitted before changing/adding the value.
>>> >>
>>> >> Can anybody please guide me in this problem.
>>> >>
>>> >> Thanks.
>>> >> --
>>> >> View this message in context:
>>> >>
>>>
http://www.nabble.com/Conditional-Validation-tf4059682s2369.html#a11533632
>>> >> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>> >>
>>> >>
---------------------------------------------------------------------
>>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> >> For additional commands, e-mail: [EMAIL PROTECTED]
>>> >>
>>> >>
>>> >
>>> >
>>> > --
>>> > http://raibledesigns.com
>>> >
>>> >
---------------------------------------------------------------------
>>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> > For additional commands, e-mail: [EMAIL PROTECTED]
>>> >
>>> >
>>> >
>>>
>>> --
>>> View this message in context:
>>>
http://www.nabble.com/Conditional-Validation-tf4059682s2369.html#a11533723
>>> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
>>
>> --
>> http://raibledesigns.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>
>

--

View this message in context:
http://www.nabble.com/Conditional-Validation-tf4059682s2369.html#a11534266

Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
http://raibledesigns.com

Reply via email to