[Zope3-Users] formlib vs. cancel button

Martin Aspeli optilude at gmx.net
Wed Feb 14 20:54:51 EST 2007


Hi,

I really thought I knew how to do this, but now I can't get it to work 
and I'm really confused.

I have a formlib EditForm, with an action like this:

     @form.action("Cancel", validator=lambda *args, **kwargs: True)
     def handle_cancel_action(self, action, data):
         nextURL = self.nextURL()
         if nextURL:
             self.request.response.redirect(self.nextURL())
         return ''

However, I still get validation errors when I click Cancel. I also tried 
a validator to return None, and no validator at all, and 
"validator=None", they all have the same effect.

Is there a proper/easy way of doing this?

Martin



More information about the Zope3-users mailing list