commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanouil Batsis <Emmanouil.Bat...@eurodyn.com>
Subject [validator] help with dependent + minlength
Date Wed, 06 Oct 2004 13:00:40 GMT
Dear validator gurus,

Consider two fields, type and time. The first mandatory, the second 
dependent on the value of the first.

What I'm trying to do enforce a not null and not empty value for the 
time field, when the type has a value of 'time'. I've been trying to do 
this for more than an hour; I was hoping someone can spot my error as i 
have become really unproductive here :-)

Below I have both my generated validator.xml fragment and my webdoclet 
tags. Please let me know what is wrong with either!

Thanks,

Manos

type field
@struts.validator type="required"  msgkey="error.form.eauction.type"


time field
@struts.validator type="minlength"
                 arg1value="${var:minlength}"
@struts.validator type="validwhen"

@struts.validator-args arg0resource="error.form.eauction.time"

@struts.validator-var name="minlength"
                      value="1"
@struts.validator-var name="test"
                      value="((type != 'time') or (*this* != null))"


And my XML fragment:


<field property="type"
    depends="required">
 <msg
   name="required"
   key="error.form.eauction.type"/>

 <arg0 key="auctionDefinitionForm.type"/>
</field>

<field property="time"
    depends="minlength,validwhen">

 <arg0
   key="error.form.eauction.time"
 />
 <arg1
     name="minlength"
   key="${var:minlength}"
     resource="false"
 />
 <var>
   <var-name>minlength</var-name>
   <var-value>1</var-value>
 </var>

 <var>
   <var-name>test</var-name>
   <var-value>((type != 'time') or (*this* != null))</var-value>
 </var>
</field>


---------------------------------------------------------------------
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