Ticket #13673 (new Bug)

Opened 3 years ago

getMultiadapter error with custom EditForm and widgets.mode in dexterity plone 4.2

Reported by: boards Owned by:
Priority: minor Milestone: 4.x
Component: Unknown Version: 4.2
Keywords: dexterityformeditForm Cc:

Description

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.widgetsalps?.mode = 'hidden' self.widgetsoperationStatus?.mode = 'hidden'

# etc.

things work fine until I get to a field which is a MultiField list-choice:

self.widgetssiteContact?.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')

Note: See TracTickets for help on using tickets.