Feature: zope.formlib: associate widget errors with widgets

Bug #528920 reported by Dieter Maurer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zope 3
Won't Fix
Undecided
Unassigned
zope.formlib
Invalid
Undecided
Unassigned

Bug Description

"zope.formlib" widgets have an "error" method to provide widget related error information. That's good.

A widget sets its error indication when it detects a problem itself. However, widget related errors can also be detected at a more global level. Example use case: a form supports multiple actions and the set of mandatory fields is different for the various actions. In such a case, an action validator will detect widget related errors. At the moment (current "zope.formlib" trunk), the widgets do not support setting widget related error information from the outside. I suggest to add a 'setInputWidgetError' method to the respective widget interface and provide a corresponding method definition in the widget base class. This would allow higher level code to associate widget errors with the respective widget.

In addition, I suggest to add an additional method "associate_errors_with_widgets" to "zope.formlib.form.Action" and call it in "Action.failure" if no explicit failure handler is defined. "associate_errors_with_widgets" would try to associate the errors from form validation with the corresponding widgets to facilitate highlighting of widgets with problems and provide error information directly at the widget.

Tres Seaver (tseaver)
Changed in zope3:
status: New → Won't Fix
Revision history for this message
Colin Watson (cjwatson) wrote :

The zope.formlib project on Launchpad has been archived at the request of the Zope developers (see https://answers.launchpad.net/launchpad/+question/683589 and https://answers.launchpad.net/launchpad/+question/685285). If this bug is still relevant, please refile it at https://github.com/zopefoundation/zope.formlib.

Changed in zope.formlib:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.