I have a form schema which inherits from another form schema. Both have fieldsets. However, the fieldsets are put in the order they are created. So the fieldset described in the last schema will be the last one. I would like it to be the first. Is there a way to do that ?
Example:
from plone.supermodel import model
from zope import schema
class FormSchema(model.Schema):
model.fieldset(
'test',
label='Test',
fields=['field1']
)
field1 = schema.Text(title=u'test')
class FormSchema2(FormSchema):
# Is last but I would like to place it first
model.fieldset(
'test2',
label='Test2',
fields=['field2']
)
field2 = schema.Text(title=u'test2')
A field set is a grouping of fields. For example, you could have a field set that contains fields describing a user's first name, middle name, last name, and business title. When a field set is added to a Visualforce page, developers can loop over its fields and render them.
Yes, because the fieldset element is used to group related form fields. Show activity on this post. I used a fieldset outside of a form to group together custom jquery datatable filters.
How to create fieldset: The first step for this would be to create the Fieldset. For example, to create field set for Account object, Go to Setup > Customize > Accounts > Field Set. You can now drag and drop all fields you want in this fieldset.
You can't, I am afraid. The schema fieldsets are always merged in reverse interface resolution order; base before derived interface. Declaring the fieldset again on the FormSchema2
schema will only result in the fieldset being listed twice.
If you have to control fieldset order, don't derive from the base schema but re-declare it.
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