I'm trying to use the ContentTreeFieldWidget for a field in my form, but I'm getting an error:
AttributeError: 'List' object has no attribute 'source'
I have this as my interface.
....
from zope import schema
from plone.formwidget.contenttree import ContentTreeFieldWidget, PathSourceBinder
from plone.directives import form
from my.product.specification import ISpecification
....
class IMyContentType(form.Schema):
form.widget('specifications',ContentTreeFieldWidget)
specifications=schema.List(title=u'Specifications',
value_type=schema.Choice(source=PathSourceBinder(object_provides=ISpecification.__identifier__)),
required=False,
)
I tried basing my example on the distribution page:
I used form.widgets in the interface instead of widgetFactory in the form class though.
When I used widgetFactory, I just get an error in the javascript:
ReferenceError: copyDataForSubmit is not defined
Also, I've used the schema.List(value_type=schema.Choice()) elsewhere too.
Why does this approach not work?