You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Sylvain Wallez <sy...@apache.org> on 2004/09/23 15:38:28 UTC
CForms: validation error bubbling
Hi all,
Looking at the paginated repeater patch [1], I again encountered the
problem of non-displayed widgets that can have validation errors and
therefore forbid form validation, leading to confusing situations for
the user.
A general solution for this problem could be to "bubble up" validation
errors: when the validation error or a widget changes (including when
it's set to null), the widget notifies its parent of this fact. That can
allow us to easily implement validation-error gatherers in container
widgets to display that there's a problem "somewhere" in the container.
For example, in the case of paginated repeater, page numbers or
scrolling buttons may give visual feedback if errors exist outside of
the displayed page.
For wizards, we could have group or struct widgets representing each
page which, by gathering errors raised by their children, would allow to
display a global validation status of the wizard or drive the user back
to offending pages.
Thoughts?
Sylvain
[1] http://issues.apache.org/bugzilla/show_bug.cgi?id=30213
--
Sylvain Wallez Anyware Technologies
http://www.apache.org/~sylvain http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Re: CForms: validation error bubbling
Posted by Vadim Gritsenko <va...@reverycodes.com>.
Sylvain Wallez wrote:
> Hi all,
>
> Looking at the paginated repeater patch [1], I again encountered the
> problem of non-displayed widgets that can have validation errors and
> therefore forbid form validation, leading to confusing situations for
> the user.
>
> A general solution for this problem could be to "bubble up" validation
> errors: when the validation error or a widget changes (including when
> it's set to null), the widget notifies its parent of this fact. That can
> allow us to easily implement validation-error gatherers in container
> widgets to display that there's a problem "somewhere" in the container.
>
> For example, in the case of paginated repeater, page numbers or
> scrolling buttons may give visual feedback if errors exist outside of
> the displayed page.
>
> For wizards, we could have group or struct widgets representing each
> page which, by gathering errors raised by their children, would allow to
> display a global validation status of the wizard or drive the user back
> to offending pages.
>
> Thoughts?
We do have <validation-error> template element. It can be extended, for
example, by adding attribute recursive="true" or some such, to collect
all errors from the given container widget. Wouldn't it solve the issue?
Or, we can add new <validation-errors> element to do the same.
Vadim