Wouldn't something like the following create functioality very similar to
that scrteenshot:
class ICriterion(interface.Interface):
"""Search criteria"""
index = schema.Choice(title=u"Index",
values = [u"Last Name", u"First Name"])
constraint = schema.Choice(title=u"Constraint",
values = [u"Contains", u"Doesn't contains"])
value = schema.TextLine(title=u"Value")
class ISearchForm(interface.Interface):
"""Form with a list of subforms"""
match_all = schema.Bool(title=u"Match All of the following",
default=True)
match_any = schema.Bool(title=u"Match Any of the following",
default=False)
criteria = zope.schema.List(
title = u"My list field",
value_type = zope.schema.Object(
title=u'my object widget',
schema=ICriterion),
)
class SearchForm(form.Form):
fields = field.Fields(ISearchForm)
...
i.e. my understanding is that schema.List can render a list of subforms for
its values along with Add and Remove buttons, everything magically
working... I have to admit that I never tried that myself though.
--
View this message in context:
http://n2.nabble.com/Complex-Forms-in-Plone%2C-which-technologies-to-use%3A-z3cform%2C-CMFForm%2C-...---tp3424468p3433716.html
Sent from the Product Developers mailing list archive at Nabble.com.
_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers