On Thu, Jul 3, 2008 at 4:05 PM, mettwoch <[EMAIL PROTECTED]> wrote: > > Hi, > > I've seen the new TG 1.05 feature to provide a function to the default > value of a widget. Please help me I'm confused now and can't see how > to use that. Let's say that I've a controller method exposed and that > gets an argument called "code". How can I provide the value of that > argument as a default to a TextField widget contained in a TableForm > exposed by that controller method. > > SomeFormFields(WidgetsList): > code = TextField() > > someForm = TableForm(fields = SomeFormFields()) > > @expose(template = "someForm") > def someMethod(self, code): > ... > return dict(someForm = someForm) > > Thanks for any hint
In your controller: return dict(someForm=someForm, value=dict(code=code)) In your kid template or whatever (just adapte to your case): <span py:content="someForm.display(value=value)">content that will be replaced</span> Florent. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

