Plone- In a dexterity.EditForm why is attempting to disable a widget causing a ConstraintNotSatisfied error? -
i'm trying disable widget in dexterity.editform, i'm getting error .
here part of interface class particular widget want disable
class irestaurant(iplace): restaurant_code = schema.textline(title=_(u""), required=false, )
iplace form.schema irestaurant inherits from. (from plone.directives)
here code dexterity.editform class:
class edit(dexterity.editform): grok.context(irestaurant) def updatewidgets(self): super(edit, self).updatewidgets() self.widgets['restaurant_code'].disabled = true
when go edit form, error:
constraintnotsatisfied: true
why error occurring , how can fix this?
also, version of plone using plone 4.3.5.
edit: when tried printing type of object self.widgets['restaurant_code'].disabled was, said nonetype object.
you might have better luck using mode property.
try this:
from z3c.form.interfaces import hidden_mode def updatewidgets(self): super(edit, self).updatewidgets() self.widgets['restaurant_code'].mode = hidden_mode
Comments
Post a Comment