cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Messing, Elad" <>
Subject AW: Re: CFORMS - Performing a Form level validation
Date Wed, 01 Jun 2005 13:21:53 GMT
Hello again Sylvain 
	I kept looking for the <fd:message> widget you mentioned, and couldn't find any reference
to it in the docs.
	Do you actually mean the <fd:output widget ?

	Thank you 

-----Ursprüngliche Nachricht-----
Von: Sylvain Wallez [] 
Gesendet: Dienstag, 31. Mai 2005 21:08
Betreff: Re: CFORMS - Performing a Form level validation

Messing, Elad wrote:

> Hi all
>         I tried looking for a "definition" text on the preferred way 
> of performing a Form level validation.
>         What I mean is that I need to perform validation that is 
> relevant to the Form -not to specific widget. I.E. - I have a form 
> with 2 widgets, and I need to check that either 1 of them has a value 
> in it.
>         So - I know I can have a validation in one of the widgets, and 
> in it write some javascript to check the other as well, and then 
> output the error to a "fi:validation-errors" tag - to show it in a 
> central place.
>         But this seems like a work around rather than a real plan..

You can add a <fd:validation> on any widget, including a form. But not every widget
can hold validation errors, as not every widget has a visual representation.

So validation on non-visual widgets should set validation errors on one of their child widgets.
Another option if there's no suitable widget to attach the error to is to add the error text
to a <fd:message> widget.

For more details, see the javadocs of
o.a.c.forms.validation.WidgetValidator and form1.xml in the samples: the "contacts" repeater
has a validator that checks row uniqueness and sets an error on the duplicate rows.

>         A second and related question will be - In my form with 2 
> widgets, each one of them has its own validation. So - they are not 
> required, but in case the user enters something into them, It should 
> be validated. After this validation, I will need to have the "Form 
> Level" validation I mentioned above.

That should occur automatically.

Hope this helps,

Sylvain Wallez                        Anyware Technologies  
Apache Software Foundation Member     Research & Technology Director

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message