[Zope] two submit buttons/ one method

Chris Withers chrisw@nipltd.com
Thu, 09 May 2002 15:56:22 +0100


Paul Winkler wrote:
> 
> In your version, where are yourEditMethod and yourAddMethod defined?
> Are they acquired from somewhere? I smell a better solution than mine,
> but I don't quite follow how this works...

This is ZPublisher being useful and it's actually documented in the dead tree version of
the Zope book.

If the action of the form is an object, say:

<form action="http://server.com/an_object">

Then the stuff I posted will result in the following method call:

an_object.yourEditMethod(REQUEST)

...of course, the parameters are adjusted by ZPublisher too to match that of your method
:-)

hope this makes sense,

Chris