[Zope3-Users] Multiple actions per button in formlib forms?

Stefan Fink stefan at work.de
Thu Sep 14 08:34:59 EDT 2006


Hi list,

how is it possible to add multiple actions per button to formlib forms?
Actually I'm trying to create a button which:
 - applies all changes made in the form
 - takes the user back to the container view


class GeneralEditForm(formlib.form.EditForm):

    ...

    # this does not work
    @formlib.form.action(u'Apply&Close')
    def handle_applyAndClose(self, action, data):
        """ apply form changes and close form."""
        self.handle_edit_action(action, data)
        self.request.response.redirect(getAbsoluteURL(
            self.context.__parent__,self.request))

    # this works
    @formlib.form.action(u'Close')
    def handle_close(self, action, data):
        """ Close will bring the user back to the container view """
        self.request.response.redirect(getAbsoluteURL(
            self.context.__parent__,self.request))

    ...


Thanks in advance,
Stefan.


More information about the Zope3-users mailing list