How can I dynamically add form fields, depending on catalog.results?
For Example:
catalog.results = ['Channel A', 'Channel B', 'Channel C',]
form.fields should be
form.fieldset Channels A {
input[type=checkbox].course a1
input[type=checkbox].course a2
input[type=checkbox].course a3
}
form.fieldset Channels B {
input[type=checkbox].course b1
input[type=checkbox].course b2
input[type=checkbox].course b2
}
Every Channel is folderish, and every Channel can contain N courses, for each channel should be a fieldset and for every cours should be a input[type=checkbox](Or MultiCheckbox) Field generated
Sorry, I updated my question, because our designer send a wrong Image
I would no recommend create a separate field for every option.
You can define a list field in your z3c.form with the
CheckBoxFieldWidget:Now register a vobaulary, name
channels.vocabulary, which returns terms based on a catalog query.Register with zcml:
The example is based on http://docs.plone.org/develop/plone/forms/schemas.html#multi-choice-example