Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #569 (closed enhancement: fixed)

Opened 13 years ago

Last modified 12 years ago

[PROPOSAL] Help text for widgets

Reported by: alberto Owned by: anonymous
Priority: normal Milestone: 0.9
Component: TG Widgets Version:
Severity: trivial Keywords: usability widgets


It would be nice IMO if widgets (or more concisely, FormFields?) could have a "help_text" attribute to display some help besides them like Django's admin does.

This help_text could even be another widget, maybe HelpWidget?, so it can be customized to display the help in other ways, for example an overlib's popup.

Widget templates would have to change to display this attribute if present in it's template_vars, but it's a trivial change.


Change History

comment:1 Changed 13 years ago by kevin

I like the notion of help widgets, but I think I'd prefer to keep widgets themselves self-contained. I'd rather see the Form object be in control of how help is displayed (just as the forms are in control of how errors are displayed). This keeps the model that a widget is a self-contained little unit, and some other object understands how to build widgets up into a unit for an application.

comment:2 Changed 13 years ago by michele

Yes, maybe we can just put the help_text attribute on a Widget, then the Form or any other CompoundWidget? is responsible of displaying it in the way he wants (js pop-up, fancy flash, ...) just like you said, exactly what we are doing for the label and form errors. I don't think we need a HelpWidget? for this thing, probably.

comment:3 Changed 13 years ago by alberto

Duh, I need to express myself better... What I meant was more in the line with what Michele understood (maybe our common mediterranean background? ;):

Add a help_text attribute to FormField? so the container Form/CompoundWidget? can grab it and display it beside the field (more or less like errors are displayed) if exists. The HelpWidget? thought was slightly crack-based :)

How about this then:

  1. Add a help_text attribute to the FormField? class. This should be set at construction/declaration time (just like the "name" attr) and be internationalizable.
  2. Update the Form widgets' templates to display the subwidget's help_text attribute if exists.

Forms can then be subclassed to display help attributes in other meaningful ways as the developer wishes.

If Kevin approves I might give it a wirl this afternoon... No backwards incompabilities should be introduced.

Regards, Alberto

comment:4 Changed 13 years ago by kevin

Yeah, that sounds fine.

comment:5 Changed 13 years ago by alberto

  • Status changed from new to closed
  • Resolution set to fixed

committed in r776

Note: See TracTickets for help on using tickets.