Adam Jones wrote:
> How would you plan on having the widgets communicate changes
> back? That is the real issue.
The bottom line here is that widgets are really designed for slapping
together all of the front-end behavior for very specific things. I
have worked around this limitation on my own by embedding controllers
specific to a widget *within* the widget package itself, so that I can
bundle backend behavior with front-end behavior. This allows you to
do things like this:
from mywidgets.widgets import InplaceEditablePersonWidget
person_widget = InplaceEditablePersonWidget()
class Root:
def person_updated(self, person_id, person_dict):
'''
gets called when a person gets updated so that you can do
any application-specific things that aren't handled by the
widget itself
'''
person = person_widget.create_controller()
person.on_update(person_updated)
This basically allows you to bundle controllers with your widgets so
that they aren't limited to frontend functionality. You could easily
use something like this to make repackagable inline-editable widgets.
--
Jonathan LaCour
http://cleverdevil.org
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---