[Grok-dev] How to effectively reuse viewlets?
Jeroen Michiel
jmichiel at yahoo.com
Mon Oct 19 08:51:22 EDT 2009
Martin Aspeli-3 wrote:
>
> Viewlets kinda suck, to be honest. They are useful for certain use
> cases, but as a general way to build composite UIs, they suffer from
> some limitations.
>
What are the alternatives? I am creating a fairly complex project, and
indeed, viewlets can get in your way, but I got them to work. I read all the
tutorials and howtos here, and based on that it seemed to me that viewlets
were the way to go for more comple UIs. I don't think I really came across
any alternatives mentioned on the grok site, apart from macro's, but that
looked to be even more trouble and code repetition.
The main problem I have with viewlets is rendering forms. I have a specific
layout that I want to see repeated on all pages. There is no such thing as a
'Formlet', so I first define the view in which the form should be rendered,
I then define a form (e.g. grok.AddForm) that renders the form and defines
the needed actions, and finally i define a viewlet that forwards the
rendering to the form class. This is quite convoluted... Is there a better
solution?
--
View this message in context: http://www.nabble.com/How-to-effectively-reuse-viewlets--tp25941437p25957859.html
Sent from the Grok mailing list archive at Nabble.com.
More information about the Grok-dev
mailing list