Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.2.4
-
None
-
Operating System: Windows XP
Platform: PC
-
31514
Description
There are six fields in the form I receive. All are required and integers. I
try to use validwhen to validate one of them against the others in the
following way:
<field property="END_DATE_DAY" depends="required,integer,validwhen">
<arg0 key="End day" resource="false"/>
<msg name="validwhen" key="errors.startEndDate2" resource="true"/>
<var>
<var-name>test</var-name>
<var-value>((this >= START_DATE_DAY) or ((END_DATE_MONTH -
START_DATE_MONTH) > (12 * (START_DATE_YEAR - END_DATE_YEAR))))</var-value>
</var>
</field>
The idea is quite simple, 'start date' cannot be later than 'end date'. As a
result this does not work, even if (this >= START_DATE_DAY) is true. The
documentation on validwhen is negligible. That is why I could not figure out
whether it is a bug or unsupported feature. Anyway, more documentation should
be provided on the feature, at least in Javadocs.
Thanks!