[z3-five] Rendering Values in an MulitCheckBoxWidget
Christian Klinger
cklinger at novareto.de
Wed Jul 11 10:45:51 CEST 2007
Hi,
i try to render a customized MultiCheckBoxWidget. The add-form works
fine. But if i try to render the edit-form the values that i turned on
in the add form are not selected in the edit-form.
This is my Widget:
-----------------------------------------------------------------------
from zope.app.form.browser import MultiCheckBoxWidget
class MultiCheckBoxVocabularyWidget(MultiCheckBoxWidget):
""" """
def __init__(self, field, request):
"""Initialize the widget."""
super(MultiCheckBoxVocabularyWidget, self).__init__(field,
field.value_type.vocabulary, request)
-----------------------------------------------------------------------
This is my formlib editform:
-----------------------------------------------------------------------
class ExtranetMembershipUpdateUser(formbase.PageAddForm):
""" ExtranetMembership Add Form """
implements(IExtranetMembershipUser)
form_fields['berechtigung'].custom_widget =
MultiCheckBoxVocabularyWidget
def setUpWidgets(self, ignore_request=False):
user['berechtigung']=['Value']
self.widgets = form.setUpWidgets(
self.form_fields, self.prefix, self.context,
self.request, ignore_request=ignore_request, data=user)
------------------------------------------------------------------------
Maybe someone of you had an idea.
Thx christian
More information about the z3-five
mailing list