my obstacle today/tonight was z3c.form+viewlet coctail. after 2h of testing and optimizing i got quite nice peace of code:

and layout_viewlet.pt

now instead of wrapping with FormWrapper we wrap with our new ViewletFormWrapper, like:
OurViewletView = wrap_form(OurCustomZ3CForm, __wrapper_class=ViewletFormWrapper)
all that is left to do is register OurViewletView with browser:viewlet directive and form is ready.
i found this wrapper really usefull and i hope it can get into plone.z3cform. or is there any other way of doing this?
No comments:
Post a Comment