Hi,

Looking at Tapestry.js' addValidator for 'Required':

required : function(field, message)
 {
     Tapestry.addValidator(field, true, function(value, event)
     {
         if (value == '')
             event.recordError(message);
     });
 },

and also the Required.java, it has a validation too:

public void validate(Field field, Void constraintValue, MessageFormatter
formatter, Object value)
          throws ValidationException
  {
      if (value == null || value.toString().equals("")) throw new
ValidationException(buildMessage(formatter, field));
  }

Why the same condition is being checked in two places, any reason? thanks.

A.C.
-- 
View this message in context: 
http://www.nabble.com/t5%3A-validator-questions...-tp16213766p16213766.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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

Reply via email to