I am using
struts 1.2.7. According to the documentation, requiredif is deprecated and validwhen should be used instead. I do not get any client-side validation using validwhen. Is there a bug in 1.2.7 or am I missing something? Other validations are working fine (required, mask etc.).
validator-rules.xml:
<validator name="validwhen"
msg="errors.required"
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"/>
validation.xml:
<field property="emailAddress" depends="validwhen">
<arg0 key="Email address" resource="false"/>
<var>
<var-name>
test</var-name>
<var-value>((sendLetter == null) or (*this* != null))</var-value>
</var>
</field>