You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Scott F. Walter" <sc...@vivare.com> on 2005/07/05 16:17:45 UTC

More Tapestry 4 Validation QUestions

1.  Can I specify more than 1 parameter to a custom validator when you 
have multiple validators???  The reason I ask this, because if I specify 
validators to component like this:

required,maxLen=4,minLen=1

The validators are sepertored by commas, so if I want multiple 
parameters to the maxLen validator what do I specify as the seperator 
betwen the parameters?

2.  If you have parmeters to a validator what method is called in the 
validator class to set the parameter.  I did a quick example and looks 
like you need to have a property in your validator class that matches 
the "name" attribute of the hivemodule.xml entry for the validator.  Is 
this true?  If so, I believe this means that you can only have 1 
parameter to a validator.  Am I correct?  If so it would also answer 
quesion #1.

thanks,
scott.
-- 

Scott F. Walter 	Scott F. Walter
Principal Consultant
Vivare, Inc.

E: scott.walter@vivare.com
E: scott@scottwalter.com
Visit scottwalter.com <http://scottwalter.com> --Point.  Click.  Explore!




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


Re: More Tapestry 4 Validation QUestions

Posted by Paul Ferraro <pm...@columbia.edu>.
Scott F. Walter wrote:

> 1.  Can I specify more than 1 parameter to a custom validator when you 
> have multiple validators???  The reason I ask this, because if I 
> specify validators to component like this:
>
> required,maxLen=4,minLen=1
>
> The validators are sepertored by commas, so if I want multiple 
> parameters to the maxLen validator what do I specify as the seperator 
> betwen the parameters?

Validators are intended to test a single condition.  If you have 
multiple parameters then it is recommended that you split your validator 
into two.
You also not have to use the validator binding.  You can define beans as 
you did in 3.0, or you can define a custom binding and register it with 
hivemind.

>
> 2.  If you have parmeters to a validator what method is called in the 
> validator class to set the parameter.  I did a quick example and looks 
> like you need to have a property in your validator class that matches 
> the "name" attribute of the hivemodule.xml entry for the validator.  
> Is this true?  If so, I believe this means that you can only have 1 
> parameter to a validator.  Am I correct?  If so it would also answer 
> quesion #1.
>
Correct.

> thanks,
> scott.



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