I'm currently doing some more integration of YUI widgets in TGWidgets, 
on top of Mr Kubacki's package,
and I wonder if there are best practices (or framework mechanisms I've 
overlooked) to..

1) have  an 'id' property much like the field_id in FormField, to be 
able to properly refer to the widget container in YUI's constructors and CSS

2) automagically including javascript and css when widgets are used in a 
page, without explicitly returning them from the controller. Many times 
I'm forced to do a census of the widgets I'm using in the template, and 
put them in the returned dict.
It would be _sweet_ to just call wid.SomeWidget() from the template 
without adding it to the controller.



For point 1), an assigment of d['id'] to a global counter.next() in 
update_params() can be enough for many cases.
An UUID makes the document so ugly to read that I'd rather avoid it.

For 2), I know there are templating packages that would let me modify 
the rendered document as an ElementTree, so that for each widget 
insertion I could check that javascript and css are properly loaded. I 
don't think this is the case for Kid, and I'm not sure about Genshi.
The YAHOO.Loader approach could work for CSS too, but I expect it would 
pose cross-browser compatibility issues.
Both approaches break on XMLHTTP-retrieved snippets.

I'm not asking for any change on the trunk, just wondering how the 
others approach the issues and what are the work-arounds.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to