Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: Release 1.5
-
Component/s: ActionBean Dispatching
-
Labels:None
Description
Prototype's Form.serialize serializes all the button and submit inputs in a form, no matter which of the buttons was clicked to submit the form. This often results in Stripes throwing and exception because more than one event name is present in the parameters. We need some way to explicitly override that behavior in Stripes and specify which event is intended to fire.
Currently, Stripes will honor the _eventName parameter only if there are no other event parameters present. It first checks a special request attribute (used for internal forwards), then parameters matching event names, then the extra path info, and finally _eventName. I propose we change the order to request attribute, then _eventName, then other parameters, then extra path info. This would allow for use of Prototype's Form.serialize without any hackish workarounds, as long as _eventName is present.
I'm not sure we should do this. This kind of change is non-backwards compatible in a very nefarious way. If we do this, anyone who was relying on the previous behavior will find pages bot behaving as expected but not blowing up.
E.g. (I think this is still correct, but I'm sure there are other examples). Some browsers, notably IE, tend not to submit the "default" button name if you hit enter in a form field. In these cases you could use _eventName to specify a default event, which would then be overridden if the user actually clicked a button on the form instead of hitting enter.