commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Liu, Arden" <Arden_...@srtelecom.com>
Subject how to check two property in one validator
Date Fri, 02 Dec 2005 16:51:52 GMT
Hi, all
I am using Commons Validator to check my Swing inputting. There are two JTextFields: one it
Time, Another is Duration. The Duration should be bigger than Time. So in checkDuration, I
need the value of Time. But I do not know how to define in <form> and <field>.
Could you give me any suggestion?
Thanks a lot.
Arden


<!DOCTYPE form-validation PUBLIC
     "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1//EN"
     "http://jakarta.apache.org/commons/dtds/validator_1_1.dtd">

<form-validation>
   <global>
          
       <validator name="checkTime"
          classname="app.common.validator.TimeValidator"
          method="validateTime"
          methodParams="java.lang.Object, org.apache.commons.validator.Field"
          msg="time.field"/>

       <validator name="checkDuration"
          classname="app.common.validator.DurationValidator"
          method="validateDuration"
          methodParams="java.lang.Object, org.apache.commons.validator.Field"
          msg="duration.field"/>
          
    </global>
    <formset>
       <form name="bertForm">
          <field property="time" depends="checkTime">
          </field>
          <field property="duration" depends="checkDuration">
          </field>
       </form>
    </formset>
</form-validation>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message