Well, it turns out there is validWhen support in springmodules.  It's right
there in FieldChecks.  You add the following to your validator-rules.xml and
hopefully all goes swimmingly:

      <validator name="validwhen"
                
classname="org.springmodules.validation.commons.FieldChecks"
                 method="validateValidWhen"
                 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"/>


mraible wrote:
> 
> I don't believe validwhen works if you're using it with Spring MVC.
> You might check the documentation on springmodules.dev.java.net to
> make sure.
> 
> Matt
> 
> On Wed, Apr 30, 2008 at 9:59 AM, Leo Barrientos C.
> <lbarrien...@opensistemas.com> wrote:
>> Hello, validwhen works form anybody in appfuse/spring/hibernate?
>>
>>  I set the <validator name="validwhen"
>>                
>> classname="org.apache.struts.validator.validwhen.ValidWhen"
>>                 method="validateValidWhen"
>>                 methodParams="java.lang.Object,
>>                       org.apache.commons.validator.ValidatorAction,
>>                       org.apache.commons.validator.Field,
>>                       org.apache.struts.action.ActionMessages,
>>                       org.apache.commons.validator.Validator,
>>                       javax.servlet.http.HttpServletRequest"
>>                 msg="errors.required"/>
>>  in validator-rules.xml
>>
>>  And set the validator.xml
>>
>>  <field property="modelo.id" depends="validwhen">
>>                <arg0 key="modelo.id" resource="false"/>
>>                <msg name="validwhen" key="error.validwhen"/>
>>                <var>
>>                    <var-name>test</var-name>
>> <var-value>(*this* != "0")</var-value>
>>               </var>
>>            </field>
>>
>>  But doesnot work (there is a select box called modelo.id)
>>
>>  Any idea?
>>
>>  ---------------------------------------------------------------------
>>  To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net
>>  For additional commands, e-mail: users-h...@appfuse.dev.java.net
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net
> For additional commands, e-mail: users-h...@appfuse.dev.java.net
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/validation-validwhen-doesnot-work-tp16986057s2369p25531244.html
Sent from the AppFuse - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net
For additional commands, e-mail: users-h...@appfuse.dev.java.net

Reply via email to