On 7 Nov 2003, at 13:26, Carmona Perez, David wrote:


Thanks Bruno,

We could have both of them, for greater flexibility.

-1 FS


It makes sense to have errors that apply to the full form, and don't need to be shown next to a field..

--------
David

-----Mensaje original-----
De: Bruno Dumon [mailto:[EMAIL PROTECTED]
Enviado el: viernes, 07 de noviembre de 2003 14:19
Para: [EMAIL PROTECTED]
Asunto: Re: RV: Woody custom validation

I'll answer both your questions in one mail:

Please, how can the validator show an error message to the end user?

Good point. Field widgets have a setValidationError() method you can use. However, only field widgets have this method, not other types of widgets. We should add this to all widgets where it makes sense.

And also, does anybody know to create a validation error that applies
to the full form, not just a given field.

I see two solutions to this:


* we add an addValidationError() method to the form object, so that
global validation errors can be set on the form. We would then also need
an extra tag for the template transformer to retrieve these errors.


* we introduce a widget who's only purpose is to gather validation (or
other) messages, i.e. a wd:messages widget. This widget would then have
a addMessage(...) method. Conceptually, this widget is a bit like the
output widget, because it doesn't react to user interaction.

The advantage of the second option is that you can have multiple of
those wd:messages widgets, so you can place them at different locations
on in the form template.

I tend to think the second option is better, but let me know what you
think of it.

+1


regards jeremy


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to