#902: [PATCH] All input widgets should have a "field_id" param to allow
overriding the DOM element's id
---------------------+------------------------------------------------------
Reporter: alberto | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone: 1.0b1
Component: Widgets | Version: 0.9a5
Severity: major | Resolution:
Keywords: |
---------------------+------------------------------------------------------
Comment (by alberto):
Thanks for the feedback :) !
Ok, how about this:
* Widget accepts a new optional parameter at the *contructor*, called
{{{id}}}. It's not a {{{param}}} as we know it which means it cannot be
overriden at display. This should settle the discrepancies Michele was
talking about.
* If passsed, this id overrides the id generated by
{{{FormField._get_field_id}}}. If not passed, everything works as it's
been working 'til now. Backwards compatible! ;)
This would make possible to have duplicated ids if the programmer wants to
shot himself on the foot ;)
I think this change should go to Widget because the id is very commonly
used in JS code to refer to elements, even if they're not InputWidgets,
for example, let's say your have separate widgets in a page, being able to
force/override an id makes it easy to connect a signal handler (in Mochi's
terms) to one of them so other widgets can force it to update when they
asyncronously change state in the app.
Apart from storing info in the id... which I'm using for an ultra-cool
widget Oprius Foundations has inspired me ;)
Alberto
--
Ticket URL: <http://trac.turbogears.org/turbogears/ticket/902>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Tickets" 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-tickets
-~----------~----~----~----~------~----~------~--~---