On Apr 9, 2006, at 8:18 PM, lateef jackson wrote:

> Ok so I added a validator to my edit.
> @turbogears.validate(form=myforms.COOL_FORM)
> def cooledit(self,...):
>   dict(editValues=..)
>
> So the problem I am having is that if I use the validator decorator  
> the form is not populated when it is first loaded. If I modify the  
> data and submit it (submits to itself) it works correctly. If I  
> comment out the validator decorator then I get the expected  
> behavior of on first page visit the data is populated from the  
> values I passed into the view from the controller. And it works  
> fine submitting to itself. Is it frowned on to use widgets and  
> submit to the same controller function? Or do we think there is a  
> bug in my code?

Have you tried passing a value to the form in the template?

def controllermethod(...)
        ...
        return dict(form=form, value=dict(name="Haifa", surname="Wehbe"))

(in the template)

${form.display(value=value)}


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

Reply via email to