"That's just a case of comments not keeping up with code changes. As of Stripes
1.5, the _eventName parameter overrides everything else, even if there
otherwise would be multiple events indicated."
yes this has been a good change. I didn't read that comment in detail, what I
was really lobbying for there was to get rid of the whole request param/submit
name thing and just use _eventName. I understand most will not go for this,
but it could maybe fall in line with best practice. Or eliminate _eventName
and force us to learn the all the browser rules and pass params accordingly.
"As of Prototype 1.6 (maybe 1.5?), you can specify in your Ajax.Updater or
Ajax.Request options { submit: "theEventName" } to specify which submit button
to include when serializing the form."
Yeah 1.6 added this and also form.serialize(true) to include submits. But it's
still somewhat worse than _eventName: "theEventName" since theEventName is
_guaranteed_ to run with that way. I could still sneak _eventName or a 2nd
submit into the first version and throw it off. IMO since _eventName has
become the authoritative source why bother with anything else?
"So... what are my alternatives?"
<a href="' onclick="add(); return false;">Add</a>
<script>
function add() {
$('_eventName') = 'add';
$('form').submit();
}
"Your form NEEDS to have at least 2 input of type "text" for IE to send the
submit button information..."
Yep, if you have 1 text field it will allow you to submit with enter. You can
write some javascript to catch key code 13 and return false, but any user is
naturally going to hit enter to submit that form..
From: Ben Gunter [mailto:[email protected]]
Sent: Wednesday, April 08, 2009 2:12 PM
To: Stripes Development List
Subject: Re: [Stripes-dev] Submit form in IE doesn't send the correct event
On Wed, Apr 8, 2009 at 1:44 PM, Newman, John W
<[email protected]<mailto:[email protected]>> wrote:
The source of the event name has always caused a bit of confusion for me - the
backend code around this was cleaned up recently, but IMO this,
* <p>
* Failing that, search for a parameter in the request whose name matches
one of the named
* events handled by the ActionBean. For example, if the ActionBean can
handle events foo and
* bar, this method will scan the request for foo=somevalue and
bar=somevalue. If it finds a
* request parameter with a matching name it will return that name. If there
are multiple
* matching names, the result of this method cannot be guaranteed and a
* {...@link StripesRuntimeException} will be thrown.
* </p>
should not exist anymore..
Don't forget about the enter key =) also prototype.js needed a patch to get
submits into form.serialize()...
As of Prototype 1.6 (maybe 1.5?), you can specify in your Ajax.Updater or
Ajax.Request options { submit: "theEventName" } to specify which submit button
to include when serializing the form.
-Ben
------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development