Hello, I posted this question in the Plone-Users List, but it might be more a Zope stuff. I am looking for some documentation about the ":method" used in some forms, for instance name="discussion_reply:method", but can't find anything. Thanks for any pointers Manuel Spuhler
--On 7. Februar 2007 17:24:57 +0100 Manuel Spuhler <manuel.spuhler@gmail.com> wrote:
Hello,
I posted this question in the Plone-Users List, but it might be more a Zope stuff.
I am looking for some documentation about the ":method" used in some forms, for instance name="discussion_reply:method", but can't find anything.
<http://www.plope.com/Books/2_7Edition/ScriptingZope.stx> -aj
On 2/7/07, Andreas Jung <lists@zopyx.com> wrote:
Andreas, that doesn't speak a word about the form-field modifier 'method'.
I am looking for some documentation about the ":method" used in some forms, for instance name="discussion_reply:method", but can't find anything.
If the request finds a form field ending in :method in the request, the id before it is appended to the request URL. This way you can have multiple callables (scripts, objects, methods, whatever) process the information from one form, depending on what submit button was pressed. It works as follows: 1/ create a form that POSTS to server/path/ 2/ use submit buttons named like 'foo:method' and 'bar:method' 3/ Create 'foo' and 'bar' in /path/ (or have them available there through acquisition or skins) Now, when a user clicks the 'foo:method' button, Zope receives a form for server/path/, and modifies the request to go to server/path/foo instead. If 'bar:method' was pressed, the request ends up at server/path/bar instead. HTH, -- Martijn Pieters
Hello Martin, quoted from http://www.plope.com/Books/2_7Edition/ScriptingZope.stx "action Appends the attribute value to the original form action of the form. This is mostly useful for the case in which you have multiple submit buttons on one form. Each button can be assigned to a script that gets called when that button is clicked to submit the form. A synonym for action is method." so basically, I interpretted it like: 'foo:action' == 'foo:method', but it's unclear. Thanks for your precision. Manuel 2007/2/8, Martijn Pieters <mj@zopatista.com>:
On 2/7/07, Andreas Jung <lists@zopyx.com> wrote:
Andreas, that doesn't speak a word about the form-field modifier 'method'.
I am looking for some documentation about the ":method" used in some forms, for instance name="discussion_reply:method", but can't find anything.
If the request finds a form field ending in :method in the request, the id before it is appended to the request URL. This way you can have multiple callables (scripts, objects, methods, whatever) process the information from one form, depending on what submit button was pressed.
It works as follows:
1/ create a form that POSTS to server/path/ 2/ use submit buttons named like 'foo:method' and 'bar:method' 3/ Create 'foo' and 'bar' in /path/ (or have them available there through acquisition or skins)
Now, when a user clicks the 'foo:method' button, Zope receives a form for server/path/, and modifies the request to go to server/path/foo instead. If 'bar:method' was pressed, the request ends up at server/path/bar instead.
HTH,
-- Martijn Pieters
On 2/8/07, Manuel Spuhler <manuel.spuhler@gmail.com> wrote:
quoted from http://www.plope.com/Books/2_7Edition/ScriptingZope.stx
Heh, I completely missed the fact that :method has been renamed to :action. Thanks for the correction! -- Martijn Pieters
participants (3)
-
Andreas Jung -
Manuel Spuhler -
Martijn Pieters