You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Michael Gentry <mg...@masslight.net> on 2009/08/11 22:15:52 UTC

Re: @Validate a user defined property

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

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


On Mon, Feb 23, 2009 at 10:54 PM, Thiago H. de Paula
Figueiredo<th...@gmail.com> wrote:
> On Sun, Feb 22, 2009 at 6:48 PM, Luther Baker <lu...@gmail.com> wrote:
>> I can create a t:form and manually validate this 'onSuccess' (
>
> You should perform validations on onValidate(), not onSuccess(). The
> 'success' word here means that validation was successful.
>
> --
> Thiago

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


Re: @Validate a user defined property

Posted by Michael Gentry <mg...@masslight.net>.
Thanks Geoff!

On Tue, Aug 11, 2009 at 7:22 PM, Geoff
Callender<ge...@gmail.com> wrote:
> 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 <mg...@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-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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


Re: @Validate a user defined property

Posted by Geoff Callender <ge...@gmail.com>.
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 <mgentry@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-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>


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


Re: @Validate a user defined property

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Tue, 11 Aug 2009 17:15:52 -0300, Michael Gentry <mg...@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-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org