[Zope3-Users] formlib vs. cancel button
Dennis Schulz
d.schulz81 at gmx.net
Wed Feb 14 22:30:47 EST 2007
I dont know if it is the "proper" way,
but when I return an empty string there is no validation error.
This was also one of the strangest things I found out with formlib.....
Dennis
Martin Aspeli escribió:
> 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
>
> _______________________________________________
> Zope3-users mailing list
> Zope3-users at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users
>
>
More information about the Zope3-users
mailing list