[Zope3-Users] Using a multicheckboxwidget instead of a multiselectsetwidget

Stephan Richter srichter at cosmos.phy.tufts.edu
Thu Jun 23 07:53:46 EDT 2005


On Wednesday 08 June 2005 10:43, Jan-Wijbrand Kolman wrote:
> In mywidgets.py:
>
>   from zope.app.form.browser import MultiCheckBoxWidget as
> MultiCheckBoxWidget_ def MultiCheckBoxWidget(field, request):
>     vocabulary = field.value_type.vocabulary
>     return MultiCheckBoxWidget_(field, vocabulary, request)
>
> In the configure.zcml:
>
>   <addform
>     name="add_foo"
>     label="Add Foo"
>     schema=".interfaces.IFoo"
>     fields="filetypes"
>     content_factory=".foo.Foo"
>     template="foo.pt"
>     permission="zope.Public"
>   >
>   <widget
>     field="filetypes"
>     class=".mywidgets.MultiCheckBoxWidget"
>   />
>   </addform>
>
> Probably there're better ways to do this...?

No, this is a good solution and should be incorporated into zope.app.form 
somehow.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training


More information about the Zope3-users mailing list