Opened 19 years ago
Last modified 18 years ago
#1 assigned enhancement
Value-widgets support validation functions
| Reported by: | dsowen | Owned by: | dsowen |
|---|---|---|---|
| Priority: | major | Milestone: | rr |
| Component: | widget | Keywords: | |
| Cc: |
Description
The activation method of a widget which allows a value to be manipulated must take an optional validating function.
Change History (4)
comment:1 Changed 19 years ago by dsowen
- Owner set to dsowen
- Status changed from new to assigned
comment:2 Changed 18 years ago by dsowen
Having widgets handle validation is a little more extensible; you could create widgets for particular fields of a database, for example, that validated against that db-field's foreign key.
comment:3 Changed 18 years ago by dsowen
- Milestone set to rr
Validation might not be able to happen until input has completed; it's only known that input is complete when the user attempts to exit from the widget.
comment:4 Changed 18 years ago by dsowen
Added support in changeset:main,80.
Leaving open until more tested.
Note: See
TracTickets for help on using
tickets.

Should it be the widget or the owning form handles validation?
If the widget handles it, then all users of widgets get validation for free. But this could be tricky. A widget doesn't really have its own entry and exit logic, except when the key-handler says to exit. That's when validation would need to happen. But I'm not yet comfortable that this won't introduce some sort of kink.
On the other hand, making the form validate means that other users of widgets must validate on their own.