You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Chris Mylonas <ch...@mrvoip.com.au> on 2010/07/21 08:42:17 UTC

tapestry validation queries?

Hi Everyone,

I'm just finishing my first tapestry (sub)project!! Woohoo!  What a  
learning experience.
I'd love to go back and pull apart the code, but this project isn't  
mine to take home and pull apart, and I don't have time on-the-job to  
do it because there's the next project already in the pipeline.

I spent a little long on input validation this afternoon - I left a  
test value maxlength=10 in some of the input fields, where it should  
have been increased to something much higher.

The application had a create, edit, delete and clone objects  
functionality.   So you could imagine, I've created some fields with  
 >10 characters and gone to edit/clone them to a new object then found  
I can't save them because input validation failed!!

I found this gem on the tapestry/guide/validation.html page:

Validation constraints can also be specified in the properties file of  
the containing page or component. The key takes the form propertyId- 
validate. For example: username-validate=required,minlength=6.

It's something I'll probably look at getting used to.  Is there a  
"global" way of configuring validation?  e.g. all strings within forms  
will be required and they'll need to be between 5 and 10 characters.   
Just asking...

Is there a difference between @Validate and t:validate in the tml?  Do  
both methods create the javascript unFocus pop up?


Cheers
Chris

Re: tapestry validation queries?

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Wed, 21 Jul 2010 03:42:17 -0300, Chris Mylonas <ch...@mrvoip.com.au>  
wrote:

> Hi Everyone,

Hi!

> It's something I'll probably look at getting used to.  Is there a  
> "global" way of configuring validation?  e.g. all strings within forms  
> will be required and they'll need to be between 5 and 10 characters.   
> Just asking...

No.

> Is there a difference between @Validate and t:validate in the tml?

No.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: tapestry validation queries?

Posted by Pablo dos Reis <pa...@gmail.com>.
Hi Chris,



> Is there a difference between @Validate and t:validate in the tml?  Do both
> methods create the javascript unFocus pop up?
>
>
To the second question see the property clientValidation from form [0].
But the other issues I will leave for the more experienced.


[0]
http://tapestry.apache.org/tapestry5.1/tapestry-core/ref/org/apache/tapestry5/corelib/components/Form.html




-- 
Pablo Henrique dos Reis