|
ToDo:
|
requiredif - field dependant validator
Deprecated, use validwhen.
сStruts1.2aildwhen戎
requiredif
validation.xmlр&
< form name="HogeHogeForm">
<field
property="Foo" depends="requiredif">
<arg0 key="Foo.error.id"/>
<var>
<var-name>field[0]</var-name>
<var-value>Bar</var-value>
</var>
<var>
<var-name>fieldTest[0]</var-name>
<var-value>EQUAL</var-value>
</var>
<var>
<var-name>fieldValue[0]</var-name>
<var-value>1</var-value>
</var>
<var>
<var-name>field[1]</var-name>
<var-value>Fuga</var-value>
</var>
<var>
<var-name>fieldTest[1]</var-name>
<var-value>EQUAL</var-value>
</var>
<var>
<var-name>fieldValue[1]</var-name>
<var-value>1</var-value>
</var>
<var>
<var-name>fieldJoin</var-name>
<var-value>AND</var-value>
</var>
Source(org.apache.struts.validator.FieldChecks.java)iieldTest
戎帥
fieldJoin
defaultR鐚
validwhenNewbie FAQCan you give me a simple example of using the requiredif Validator rule?'
<form name="HogeHogeForm">
<field
property="Foo" depends="validwhen">
<arg0 key="Foo.error.id"/>
<var>
<var-name>test</var-name>
<var-value> ((((Bar == '1') OR (Fuga == '1')) AND (*this* == null)) OR (*this* != null) </test>
</var>
</field>
ラ1у
_ 綽篋 障榊 ㏍筝㏍違違障c