You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Aj Gregory <aj...@u.washington.edu> on 2006/02/01 16:34:07 UTC

Configuring translators and validators

It seems very limiting that you can only specify a class for 
"tapestry.form.translator.Translators " and 
"tapestry.form.validator.Validators" configuration points.

I'd really like an option to setup a service id or better yet an object 
so I can create more interesting translators and validators which depend 
on other services.   For example if I wanted a validator which takes the 
contents of an input field and looks up if it's valid by making a 
database call.

Has anybody else tried to get around this limitation?

-Aj
<http://jakarta.apache.org/tapestry/tapestry/hivedocs/config/tapestry.valid.Validators.html> 


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


Re: Configuring translators and validators

Posted by Ron Piterman <rp...@gmx.net>.
first, the validators parameter is a normal parameter, just construct 
your own validator - just the way you like it to be, add a property 
accessor method to it, and use ognl:myValidator instead of validators:...

Then again, if you want to use a bean, you can still easily combine it 
using "validators:$byBeanName,required"

you can wire services to your bean by injecting them to your class and 
setting the bean's properties -

so there are actually quite some ways to do what you want - (almost) no 
limitations :)

Cheers,
Ron


Aj Gregory wrote:
> It seems very limiting that you can only specify a class for 
> "tapestry.form.translator.Translators " and 
> "tapestry.form.validator.Validators" configuration points.
> 
> I'd really like an option to setup a service id or better yet an object 
> so I can create more interesting translators and validators which depend 
> on other services.   For example if I wanted a validator which takes the 
> contents of an input field and looks up if it's valid by making a 
> database call.
> 
> Has anybody else tried to get around this limitation?
> 
> -Aj
> <http://jakarta.apache.org/tapestry/tapestry/hivedocs/config/tapestry.valid.Validators.html> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


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


Re: Configuring translators and validators

Posted by gaz jones <ga...@gmail.com>.
cant you just write a validator class that looks up if its valid in a
database and then add it to your config file and use that? how is that
limiting??

On 2/1/06, Aj Gregory <aj...@u.washington.edu> wrote:
>
> It seems very limiting that you can only specify a class for
> "tapestry.form.translator.Translators " and
> "tapestry.form.validator.Validators" configuration points.
>
> I'd really like an option to setup a service id or better yet an object
> so I can create more interesting translators and validators which depend
> on other services.   For example if I wanted a validator which takes the
> contents of an input field and looks up if it's valid by making a
> database call.
>
> Has anybody else tried to get around this limitation?
>
> -Aj
> <
> http://jakarta.apache.org/tapestry/tapestry/hivedocs/config/tapestry.valid.Validators.html
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>