There's a long-standing problem with recording errors in onSuccess(). I think that's what Michael's referring to.

        https://issues.apache.org/jira/browse/TAPESTRY-1972

So the example should be changed to this:

   String onValidateForm()
   {
       if (!authenticator.isValid(userName, password))
       {
form.recordError(passwordField, "Invalid user name or password.");
       }
   }

   String onSuccess()
   {
       return "PostLogin";
   }

I've lodged https://issues.apache.org/jira/browse/TAP5-812 .

Geoff


On 12/08/2009, at 8:34 AM, Thiago H. de Paula Figueiredo wrote:

Em Tue, 11 Aug 2009 17:15:52 -0300, Michael Gentry <mgen...@masslight.net > escreveu:

To open up an old can of worms, the documentation shows doing
validation in onSuccess() ...

http://tapestry.apache.org/tapestry5/guide/validation.html

   String onSuccess()
   {
       if (!authenticator.isValid(userName, password))
       {
form.recordError(passwordField, "Invalid user name or password.");
           return null;
       }

       return "PostLogin";
   }

I would say that input validation is not being done in onSuccess(). IMHO, that's view logic being invoked, not input validation per se. :)

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to