You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ivano Luberti <lu...@archicoop.it> on 2009/03/06 18:21:54 UTC

cross field validation with empty fields

Hello, we are using T4.1
We have to validate a form and we don't want to do it client side.
Let say we have three text fields.
The validation should implement the following rule:
if (fielda="") && (fieldb="" || fieldc="")
 then throw new Exception("");

The problem is that we cannot link the validation to neither field
because they can be empty and the custom validator we are trying to
implement is nevere called if the field is empty.
We tried to  follow the Identity validator but it is also not called
when the field to which is associated is empty.

Is there another way to accomplish cross field validation ?

It seems to us that in T4.1  lacks a validator attribute for the form
component.


-- 
==================================================
dott. Ivano Mario Luberti
Archimede Informatica societa' cooperativa a r. l.
Sede Operativa
Via Gereschi 36 - 56126- Pisa
tel.: +39-050- 580959
tel/fax: +39-050-9711344
web: www.archicoop.it
==================================================


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


Re: cross field validation with empty fields

Posted by Andreas Andreou <an...@di.uoa.gr>.
See http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/form/validator/Validator.html
Probably just override getAcceptsNull()

On Fri, Mar 6, 2009 at 7:21 PM, Ivano Luberti <lu...@archicoop.it> wrote:
> Hello, we are using T4.1
> We have to validate a form and we don't want to do it client side.
> Let say we have three text fields.
> The validation should implement the following rule:
> if (fielda="") && (fieldb="" || fieldc="")
>  then throw new Exception("");
>
> The problem is that we cannot link the validation to neither field
> because they can be empty and the custom validator we are trying to
> implement is nevere called if the field is empty.
> We tried to  follow the Identity validator but it is also not called
> when the field to which is associated is empty.
>
> Is there another way to accomplish cross field validation ?
>
> It seems to us that in T4.1  lacks a validator attribute for the form
> component.
>
>
> --
> ==================================================
> dott. Ivano Mario Luberti
> Archimede Informatica societa' cooperativa a r. l.
> Sede Operativa
> Via Gereschi 36 - 56126- Pisa
> tel.: +39-050- 580959
> tel/fax: +39-050-9711344
> web: www.archicoop.it
> ==================================================
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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