struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Turner <tur...@blackbear.com>
Subject Re: Weirdness/possible bug in Validator dependencies
Date Mon, 15 Jul 2002 20:53:13 GMT
At 03:57 PM 7/15/2002, David Winterfeldt wrote:
>The Validator was designed to work this way so there
>could different groupings of validation rules.
>Because some times it may not make sense to continue
>with certain validations until the form is in a
>certain state.  The depends attribute in the pluggable
>validator definitions is what controls these
>groupings.  So to have validation performed on
>everything at the same time, the depends attribute can
>be either zero length or removed.


But if I remove the remove depends from the validation.xml and
set up my date of birth rule to say:

    <field
      property="dateOfBirth"
      depends="required,minlength,date">
      <arg0 key="subscriberForm.dateOfBirth.label"/>
      <arg1 name="minlength" key="${var:minlength}" resource="false"/>
      <var>
        <var-name>minlength</var-name>
        <var-value>10</var-value>
     </var>
     </field>

If I put in a blank entry for it (all other fields filled out), I get:
Date of Birth is not a date.
Date of Birth is required.

(I would expect only the "required" message, since it comes first in the list.

If I fill it out with 08/0A, I get:
Date of Birth is not a date.
Date of Birth can not be less than 10 characters.

(I would expect only the "is not a date" message)

If I fill it out with 08/02/62, I get
Date of Birth can not be less than 10 characters.

Which is what I expect.

I'm going to put it bluntly.  For every "reasonable" expectation I could 
make about how
validations should work with depends, it does something different and 
incompatible
with the way people code validations on forms in commercial environments 
dealing
with end users.

James




--
To unsubscribe, e-mail:   <mailto:struts-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-dev-help@jakarta.apache.org>


Mime
View raw message