[Grok-dev] Viewlet document for layouts

Tim Terlegård tim.terlegard at valentinewebsystems.se
Tue May 20 15:15:24 EDT 2008


On May 14, 2008, at 11:06 AM, Graham Stratton wrote:
> Thanks for that, it got me started quickly with viewlets in Grok. I  
> came across a couple of issues with forms, though:
>
> 1. Putting the redirect in the update method means that when the  
> form data is invalid (you didn't specify a fruit name), you are  
> still redirected, so you don't get the form errors. Putting the  
> redirect on the end of the add action fixed that for me.

Right. I fixed that in the example code in subversion.


> 2. The default Grok form templates contain <html> and other tags  
> which shouldn't be there. Is customising the template and using it  
> for all forms the best approach here?

Yeah, you can't use the standard one. I now removed <html> and <body>
from the standard edit template and made the add form use that instead.
So if you check the example application again it should work.

grok.template(...) doesn't seem to work on grok.AddForm, so you have to
specify template as a class variable instead. I don't know if there's  
a reason
for it not to work.

/Tim


More information about the Grok-dev mailing list