Issues with actions:
1. Multiple submit buttons on the same page and submit with "Enter".
Problem: Browsers have undefined behavior with regard to multiple submit
buttons on the same form. Some of them provide the name=value pair of
the first submit button of the form some don't provide any name=value
pair of the submit buttons.
2. Unable to use JavaScript to define the _action_methodName style
actions.
Trying to resolve the first issue, I wrote some JavaScript to handle the
form submit. Unfortunately you cannot change the name of a form
element. You can however change the value. Solution to Issue #1 is
then to have a hidden field that is named _action_ as the old style
actions and use <input type="button" name="methodName"
onClick="submitForm(this)" value="Do Action"> where submitForm() uses
the name of the button and assigns it to the hidden field before
submitting the form.
3. "Old Style" actions not handled the same as "_action_methodName"
actions.
"Old Style" actions pass transaction to the method call. where
"_action_methodName" actions do not. This puts a wrinkle in my solution
listed above.
Proposal:
I would propose that "_action_"="methodName" and "_action_methodName"=1
be treated the same. An addition to the if statement in respond is all
that is required.
for action in self.actions():
if (req.hasField('_action_%s' % action) or
(req.hasField('_action_%s.x' % action) and
req.hasField('_action_%s.y' % action) or
(req.hasField('_action_') and req.value('_action_') == action ))
):
if self._actionSet().has_key(action):
self.handleAction(action)
return
Then the section about Old Style actions could go away, or turn into a
Configurable option. SupportOldStyleActions = 1 or 0 If it is a
Configurable option, I think it precedes the "_action_methodName"
section.
--Karl
--
Karl Putland
Director of Technical Operations
ShipEze Inc
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss