Hi Roger,

Roger Demetrescu wrote:
> Hi Walter and Sanjiv
>
>
> On Thu, Jun 26, 2008 at 04:20, Sanjiv <[EMAIL PROTECTED]> wrote:
>   
>> Hi Roger,
>>
>> The WidgetBunch is no more required and the widget may be directly
>> stuck to the tmpl_context. So all pylons.c.w becomes pylons.c, i.e.
>>
>>  pylons.c.form = create_movie_form
>>
>> and the widget can be obtained in the template directly from the
>> tmpl_context as
>>
>>  ${tmpl_context.form(value=value)}
>>
>> The docs seem to be not yet to be updated as this is a very recent
>> change.
>>     

BTW, you can also import widgets directy from the template. This is
useful for JS or CSS Links or for widgets that don't submit any input
(hence you don't need them in the controller to perform validation).
Widgets that require js or css links will work correctly too.
>
> Ok... I did a quick test today morning and it worked indeed...
>
> However, I am intrigued with the actual code of Toscawidget's  
> mods/pylonshf.py
>
> ===================
> def _render_func_wrapper(func):
>      ...cut...
>     tw_extra_doc = """\
> This version is a ToscaWidgets wrapper which collects resources in
> pylons.g.w and pylons.g.c and makies them available at pylons.c.resources
> so the base template can render them.
>
> It also sets the default_view if the engine name is overrided when calling me.
> """
> ===================
>
>
>
> It seems it still looks at pylons.c.w and pylons.g.w... Is it only for
> compatibility ?
>   

Yes, these are legacy functions. I should probably put a deprecation
notice on them.

> I didn't test the form with a javascript/css resource. Are these resources 
> been
> correctly collected ?
>   

Yep, take a look here for the details:
http://toscawidgets.org/documentation/ToscaWidgets/modules/resource_injector.html


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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to