You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Denis Souza <ds...@sti.com.br> on 2006/05/04 22:51:46 UTC

Variable validation

Hi,

 

I have an input field that needs to be validated like this:

 

validators="validators:required,min=1,max=X"

 

where X is a value that will be different whenever the page is loaded.
However, at least as far as I know, tapestry's validation mechanism only
allows you to set X to a static value. Anyone know a way I can make this
work?

 

Thanks,
Denis

 


Re: Variable validation

Posted by Aleksej <al...@ivs.lt>.
Denis Souza wrote:
> Hi,
>
>  
>
> I have an input field that needs to be validated like this:
>
>  
>
> validators="validators:required,min=1,max=X"
>
>  
>
> where X is a value that will be different whenever the page is loaded.
> However, at least as far as I know, tapestry's validation mechanism only
> allows you to set X to a static value. Anyone know a way I can make this
> work?
>
>  
>
> Thanks,
> Denis
>
>  
>
>
>   
Max is standard validator, so as any validator it should be a POJO.
So, you probably can get it as bean and set your custom value with OGNL.
If it will not work, you always can create your custom validator ( it is 
easy ),
instantiate it as bean on your page ,set all required values for that 
bean and then
use it as validator.



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