I'm trying to open a custom editform which would only show one field from a form with 12 fields:
class EditForm(dexterity.EditForm):
grok.name('editCustom')
grok.context(IInfo)
def updateWidgets(self):
super(EditForm, self).updateWidgets()
self.widgets['alps'].mode = 'hidden'
self.widgets['operationStatus'].mode = 'hidden'
# etc.
things work fine until I get to a field which is a MultiField list-choice:
self.widgets['siteContact'].mode = 'hidden'
(this is the entry in the form.Schema):
siteContact = schema.List(
title=_(u"Site Contact"),
description =_(u"Select Site Contacts"),
value_type=schema.Choice(vocabulary=("test.siteContact")),
required=False,
)
but when I try to access the custom EditForm I get:
Module z3c.form.widget, line 140, in render
Module zope.component._api, line 109, in getMultiAdapter
ComponentLookupError: ((<Container at /test/first>, <HTTPRequest, URL=http://localhost:8080/test/first/@@editCustom>, <Products.Five.metaclass.EditForm object at 0x08F9D9F0>, <zope.schema._field.List object at 0x084844B0>, <OrderedSelectWidget 'form.widgets.siteContact'>), <InterfaceClass zope.pagetemplate.interfaces.IPageTemplate>, 'hidden')