Eoghan schrieb:
> I'm looking for a way to edit the label text in a widget from a
> controller, e.g. something like the following pseudo code:
> 
>     @expose()
>     def myform(self, **kwargs):
>           if some_condition:
>                  my_list_form.myfield.label += " Some extra text"
>           return dict(my_list_form=my_list_form)
> 
> I've tried something like this and have gotten ValueError: It is not
> threadsafe to modify widgets in a request

One solution is creating two forms (outside the controller) which only 
distinguish in this label, then you can do this:

     return dict(my_form=my_form_2 if some_condition else my_form_1)

Not very elegant and does not scale well if you have many different 
variations of labels, I know.

-- Christoph


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