FormFieldsContainers (Forms and FieldSets) now [1855] provide a
function called "field_for" to their template for easier and more
powerful template layout. Without it it was impossible to grab a
subfield's effective 'field_id' or 'name' (for javascripting) or it's
label (for <label />).
Example, his was impossible before:
<label class="fieldlabel"
for="${field_for('numero').field_id}"
py:content="field_for('numero').label" />
Also added 2 handy properties to InputWidget for use with
"field_for" (beware: unexpected/unaccurate results when used outside
the parent widget's template!):
* fq_name -> Fully qualified name (including path) of the widget.
* error -> Error for the widget as retrieved from the
request.validation_errors.
Now these are equivalent:
* display_field_for('foo') == field_for('foo').display(value_for
('foo'), **params_for('foo'))
* render_field_for('foo') == field_for('foo').render(value_for
('foo'), **params_for('foo'))
* error_for('foo') == field_for('foo').error
No backwards incompatible changes.
Enjoy! :)
Alberto
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears-trunk
-~----------~----~----~----~------~----~------~--~---