Stripes

_eventName should override other event specifiers

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor 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.

Activity

Hide
Tim Fennell added a comment - 19/May/08 6:48 AM

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.

Show
Tim Fennell added a comment - 19/May/08 6:48 AM 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.
Hide
m.j.milicevic added a comment - 19/May/08 7:10 AM

Another question is, should Stripes fix bugs within JS libraries.
Here is a form submit (test) page for different JS libraries:

http://www.malsup.com/jquery/form/comp/

Show
m.j.milicevic added a comment - 19/May/08 7:10 AM Another question is, should Stripes fix bugs within JS libraries. Here is a form submit (test) page for different JS libraries: http://www.malsup.com/jquery/form/comp/
Hide
Gregg Bolinger added a comment - 19/May/08 8:47 AM

Big huge don't do this for both reasons already mentioned.

Show
Gregg Bolinger added a comment - 19/May/08 8:47 AM Big huge don't do this for both reasons already mentioned.
Hide
Ben Gunter added a comment - 20/May/08 9:40 AM

Turns out this was the way most people expected it to work anyway, and it does offer some valuable flexibility in some situations.

http://www.nabble.com/Another-quick-poll-to17326251.html

Show
Ben Gunter added a comment - 20/May/08 9:40 AM Turns out this was the way most people expected it to work anyway, and it does offer some valuable flexibility in some situations. http://www.nabble.com/Another-quick-poll-to17326251.html

People

Vote (0)
Watch (0)

Dates

  • Created:
    19/May/08 6:44 AM
    Updated:
    04/Jan/11 3:10 PM
    Resolved:
    20/May/08 9:40 AM