On Nov 16, 2006, at 9:50 PM, Jonathan LaCour wrote:

>
> I swear I have done this before, but its not working for me now.  How
> do I display multiple date picker widgets on the same page with  
> totally
> different field ids?  I have tried this:
>
> In my controller:
>
>      @expose(...)
>      def action(self, ...):
>          ...
>          return dict(
>              date_picker=CalendarDatePicker()
>          )
>
> In my template:
>
>      <ul>
>        <li py:for="item in items">
>          ${date_picker.display(field_id='picker_%s' % item.id)}
>        </li>
>      </ul>
>
> ... but I still get the same id on every single widget.  What am I
> doing wrong?

Unfortunately the field_id cannot be changed at display time (http:// 
trac.turbogears.org/turbogears/ticket/902). The safest way to alter  
it is to name the widget. However, there's no portable way to query  
the id outside "update_params" or the widget template when the widget  
is a child of a compound widget (as I've mentioned in another recent  
thread, this last  limitation has been removed in TGWidgets)

I infer from the template code you provided that you want a list of  
pickers.... maybe a subclass of a RepeatingWidget could help there?  
This will generate different ids for every picker.

Regards,
Alberto


--~--~---------~--~----~------------~-------~--~----~
 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