[z3-five] [Zope3-Users] Select Field with Widget

Dennis Schulz d.schulz81 at gmx.net
Tue Nov 28 14:21:19 CET 2006


Hello,

I made a select field that works on the add form (formlib) without any
problems.

However, in the edit form I have always an attribute error.

I think there should not be any problems on vocabulary etc since the add
form can render without any problems and custom widgets.

Maybe there is a problem with default values? How is it possible to set
the selected value in a SelectWidget?

Zope 2.9.5, Plone 2.5.1, Five 1.4.2

Dennis



Traceback (innermost last):
  Module ZPublisher.Publish, line 115, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 41, in call_object
  Module zope.formlib.form, line 757, in __call__
  Module Products.PurchaseRequisition.browser.supplier, line 564, in update
  Module Products.Five.formlib.formbase, line 54, in update
  Module zope.formlib.form, line 720, in update
  Module zope.formlib.form, line 790, in setUpWidgets
  Module zope.formlib.form, line 385, in setUpEditWidgets
  Module zope.schema._bootstrapfields, line 171, in get
AttributeError: countrySelect

Here is the field in the interface:

    countrySelect = Choice(
        title=u"countrySelect",
        description=u"countrySelect",
        values=vocabulary)

Here is the editForm:

class SupplierEditView( formbase.EditFormBase ):
     """
     Support View for Edit Form
     """
     def __init__(self, context, request):
         formbase.EditFormBase.__init__(self, context, request)
         self.request.SESSION['supplierform'] = 'edit'
     form_fields = form.Fields(prInterfaces.ISupplierTable, for_input=True)
     form_fields= 
form_fields.omit('isDeleted','pr_supplier_ID','pr_country_ID')
     template = ZopeTwoPageTemplateFile('www/supplier_pageform.pt')
     prefix = 'edit'






_______________________________________________
Zope3-users mailing list
Zope3-users at zope.org
http://mail.zope.org/mailman/listinfo/zope3-users





More information about the z3-five mailing list