Re: [Zope3-Users] zope.formlib view action is calling two times ?

2007-09-04 Thread Stephan Richter
On Tuesday 04 September 2007 02:00, Baiju M wrote:
> When I click 'Preview' or 'Save' button, the actions are called two
> times, any idea ?

You should use z3c.form. :-)

(Sorry, I would love to help, but I am just not supporting formlib 
anymore. ;-)

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] zope.formlib view action is calling two times ?

2007-09-03 Thread Baiju M

Hi,
  I have a view class like this:

class EditTestPage(form.EditForm):
   form_fields = form.Fields(ITestPage)
   template = namedtemplate.NamedTemplate('page_edit')
   output = ""

   actions = form.Actions(
   form.Action('Save', success='handle_save_action'),
   form.Action('Preview', success='handle_preview_action'),
   )

   def handle_save_action(self, action, data):
   if form.applyChanges(self.context, self.form_fields, data):
   self.status = 'Object updated'
   else:
   self.status = 'No changes'
   self.request.response.redirect('.')

   def handle_preview_action(self, action, data):
   print "Test"
   self.output = "Test"

When I click 'Preview' or 'Save' button, the actions are called two 
times, any idea ?


Regards,
Baiju M

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