Search code examples
plonedexterity

Why is there no factory for CheckBoxFieldWidget?


The common approach for assign a widget to a field in Dexterity is something like that

form.widget(hours=DataGridFieldFactory)
hours = schema.List(title=u'Hours',?
                    default=hoursDefault,
                    value_type=DictRow(title=u'Hours', schema=IHours)

The Dexterity documentation mentions CheckBoxFieldWidget here:

http://plone.org/products/dexterity/documentation/manual/developer-manual/reference/widgets-1

However there is CheckBoxFieldWidgetFactory that could be used the same way for

form.widget(forProducts=checkbox.CheckBoxFieldWidget)
forProducts = schema.List(title=u'Products',
                          value_type=schema.Choice(source=productsVocabulary))

What is the right way for using the CheckBoxFieldWidget here?


Solution

  • CheckBoxFieldWidget is the factory for CheckBoxWidget. Did you encounter a problem using the code you provided above?