You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "Liu, Arden" <Ar...@srtelecom.com> on 2005/12/02 17:51:52 UTC

how to check two property in one validator

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