mario henrique wrote:
> I think,
>
> that having observers in widgets, would be a plus to turbogears, like in JSF
> (Java Server Faces).
> How the thing works?
> You create a widget and associates some event that occurs in this widget
> with one method in the server, and the application write all javascript
> necessary to you.
> example:
>
> nowadays:
>
> apartmentType = widgets.TextField(
> name = *"apartamentType"*,
> label = *"Name: "*,
> attrs = dict(maxlength = *"64"*, size
> = *"30"*),
> validator = validators.String(max =
> 64, not_empty = True),
> help_text = *""*
> )
>
>
> with event handler, the widget could be
>
> apartmentType = widgets.TextField(
> name = *"apartamentType"*,
> label = *"Name: "*,
> attrs = dict(maxlength = *"64"*, size
> = *"30"*),
> validator = validators.String(max =
> 64, not_empty = True),
> help_text = *"",
> *event_handler = dict(*'onchange',
> 'selectedApJs', "turbogears.url('selectedAp')")
> * )
>
> where
> onchange = javascript event
> selectedApJs = javascript function to work with data returned by *
> turbogears.url('selectedAp')*
> selectAp = method in the server, invoked by any change on this textfield.
It looks like the RPC widget should do most of what you want (could be
extended to fully support this concept), but it needs to be documented
and is not being used in places where it seems like it should. It
really shouldn't be too hard to put together a widget that does what
you are looking for.
I think isaac is correct on this point. The problem is that it is so
easy to put together case-by-case solutions for this that no one has
taken the extra time for a generalized one.
-Adam
>
>
> I think is this.
>
> mario h.c.t.
>
> *
> *
>
> 3--
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---