I have a very long portlet edit screen so I'd like to group its fields using fieldsets (and then probably layouting those into native form tabs, like those used in content's edit view).
Is this possible with zope.formlib?
To conclude, the answer for Plone 4 really is to use z3c.form based portlets and create fieldsets by inheriting the form schema from plone.supermodel.model.Schema and defining the fieldsets using plone.autoform.directives.fieldset: https://pypi.python.org/pypi/plone.autoform#organizing-fields-into-fieldsets
The support for them was introduced in plone.app.portlets 2.3 (while the latest Plone 4 version during writing is 2.5.1).
It should be enough to use a following z3c.form based portlet form base classes instead of the formlib ones:
from plone.app.portlets.browser.z3cformhelper import AddForm
from plone.app.portlets.browser.z3cformhelper import EditForm
It's also good to know that z3c.form based portlets will be the default in Plone 5 (and base classes in z3cformhelper are made the default base classes).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With