> -----Original Message-----
> From: Carolina Serrano [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 21, 2004 2:00 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Validator Framework
> 
> 
> Yes, you are right, but the thing is that we have to validate 
> in both sides.
> I ´ll try to be more specific.
> 
> We have this situation:
> 
> date: 21/12/2004
> dateGreaterEqualThan: 21/12/1    --> this is an error because 
> it is not a
> DATE.

Okay so you have 3 validations.
1) date is a date
2) dateGreaterEqualThanis a date
3) dateGreaterEqualThan is >= date.

and if I understand you, you have something like this in validation.xml:

<field property="date" depends="date">
blah
</field>
<field property="dateGreaterEqualThan" depend="date, dateGreaterEqualThan">
blah
</field>

And it's this second one that's giving you some trouble.  Specifically the 
error message is not correct.  When you have two or more validations specified, 
the error message should treate them as one failure.  So you're message should 
say something like:
"The second date must a valid date and Greater then the first date."
I don't think you can specify a different message for each check in the list.



> 
> 
> I got the following message:  the "dateGreaterEqualThan" is minor than
> "date" --> this shouldn´t happen because i must get the 
> message: it is not a
> date. This date validation should be done by "date".
> 
> 
> i attach the validator_rule.xml. 
> 
> thanks for your help,
> 
> ------------------------------------------------------------
> VALIDATOR_RULE.XML
> 
> <validator name="dateGreaterEqualThan"
> 
> classname="..validator.ValidatorRules"
> 
> method="dateGreaterEqualThan"
> 
> methodParams="java.lang.Object,
> 
> org.apache.commons.validator.ValidatorAction,
> 
> org.apache.commons.validator.Field,
> 
> org.apache.struts.action.ActionErrors,
> 
> javax.servlet.http.HttpServletRequest"
> 
> msg="errors.dateGreaterEqualThan"
> 
> depends="date"
> 
> jsFunctionName="DateGreaterEqualThanValidations">
> 
> <javascript><![CDATA[........
> 
> 
> 
> 
> 
> 
> -----Mensaje original-----
> De: Jim Barrows [mailto:[EMAIL PROTECTED] 
> Enviado el: Martes, 21 de Diciembre de 2004 05:35 p.m.
> Para: Struts Users Mailing List
> Asunto: RE: Validator Framework
> 
> 
> 
> 
> > -----Original Message-----
> > From: Carolina Serrano [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, December 21, 2004 1:35 PM
> > To: [EMAIL PROTECTED]
> > Subject: Validator Framework
> > 
> > 
> > 
> > I'm using the validator framework , doing validations that 
> depends on
> > others.
> > 
> > for example: dateafterthat depends on  date.
> > 
> > the dependations in the server run ok, 
> > but it failed  when it has to validate in the client both: 
> > 1st date and 2nd
> > dateafterthan.
> > 
> > According the documentation: "if  1st(date) fail don't 
> > continue", so that
> > error shouldn´t happen. 
> > 
> > The first validation does not ocurre in the client side but the 2nd
> > validation does. There is no error in server side.
> 
> Both validations must happen on either the server, or the 
> client side.  You
> can't mix where they happen using the validation framework, 
> especially if
> the first is supposed to fire on the server.
> 
> 
> 
> > 
> > Thanks 
> > Carito 
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to