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

2006-09-18 Thread Stefan Fink
Thanks Martjin. That did the trick :-)

Martijn Pieters wrote:
 On 9/15/06, Bjorn Tillenius [EMAIL PROTECTED] wrote:
 This is not true. The decorator also returns the action, meaning that
 self.handle_edit_action will be an Action, not a method.
 
 You are absolutely right, and *bingo*.  Martin Aspelli was right all
 along, and I haven't been paying attention.
 
 Stephan, the following will work:
 
  @formlib.form.action(u'ApplyClose')
  def handle_applyAndClose(self, action, data):
  apply form changes and close form.
  # handle_edit_action is an Action. Call it's success method.
  self.handle_edit_action.success(data)
  self.request.response.redirect(getAbsoluteURL(
  self.context.__parent__,self.request))
 


-- 
__
S t e f a n F i n k | [EMAIL PROTECTED] Internet Informationssysteme GmbH
EMail:   [EMAIL PROTECTED] | Wandalenweg 5,  20097 Hamburg,   Germany
T/F: 040/23 88 09-00/29 | http://cms-mit-typo3.de   http://work.de
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


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

2006-09-15 Thread Bjorn Tillenius
On Thu, Sep 14, 2006 at 10:21:34PM +0200, Martijn Pieters wrote:
 On 9/14/06, Martin Aspeli [EMAIL PROTECTED] wrote:
 Stefan Fink wrote:
  Error object: 'Action' object is not callable
 
 I wonder if this has to do with the @form.action... decorator on
 handle_edit_acion? Try to take it off and/or replicate the code of the
 edit action itself.
 
 No, all the decorator does is add an Action object to the class
 attribute 'actions' (which it creates if it doesn't yet exist).

This is not true. The decorator also returns the action, meaning that
self.handle_edit_action will be an Action, not a method.

Regards,

Bjorn
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


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

2006-09-15 Thread Martijn Pieters

On 9/15/06, Bjorn Tillenius [EMAIL PROTECTED] wrote:

This is not true. The decorator also returns the action, meaning that
self.handle_edit_action will be an Action, not a method.


You are absolutely right, and *bingo*.  Martin Aspelli was right all
along, and I haven't been paying attention.

Stephan, the following will work:

 @formlib.form.action(u'ApplyClose')
 def handle_applyAndClose(self, action, data):
 apply form changes and close form.
 # handle_edit_action is an Action. Call it's success method.
 self.handle_edit_action.success(data)
 self.request.response.redirect(getAbsoluteURL(
 self.context.__parent__,self.request))

--
Martijn Pieters
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


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

2006-09-14 Thread Martijn Pieters

On 9/14/06, Martin Aspeli [EMAIL PROTECTED] wrote:

Stefan Fink wrote:
 Error object: 'Action' object is not callable

I wonder if this has to do with the @form.action... decorator on
handle_edit_acion? Try to take it off and/or replicate the code of the
edit action itself.


No, all the decorator does is add an Action object to the class
attribute 'actions' (which it creates if it doesn't yet exist).

Without a proper traceback we're just guessing here. Somewhere
something is trying to treat a Action instance as a callable.

--
Martijn Pieters
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users