[Seaside-dev] submitFormNamed: weirdness
Michael Lucas-Smith
mlucas-smith at cincom.com
Wed Nov 28 16:30:49 UTC 2007
Michel Bany wrote:
> Hi Michael,
>
> I do not quite understand your description of the weirdness. My
> understanding is that the POST is the result of submitting the form,
> while the GET is the result of a redirect generated by the handling of
> the POST by Seaside.
Yeah.. it doesn't actually happen that way. Unless onClick returns false
at the end (which submitFormNamed: doesn't make it do, but #ignoreURL
does) the web browser will run the javascript which will fire off the
POST as an asynchronise call - and then follow the href. So you get two
requests almost immediately form the browser on different connections.
If you make the onClick event return false (by calling #ignoreURL) then
the POST is still fired off as an asynchronise call and as a result, the
response won't be followed - even if it says to redirect to a new url.
So you'll get the POST happen but the page won't go anywhere.
Just FYI, the alltests Submit tab which has an example where you can
type a number in to an input field, then hit ++ or --, the submit should
take the number in the input field, then do a ++ or -- .. however, it
ignores the input field based on the race condition described in the
previous email.
May be this is only Firefox 2 which might explain why it wasn't picked
up, but I have a feeling it's more general a behavior. It's not that big
a deal, more of a huge "Surprise" when you dig in to the guts of what is
going on.
Cheers,
Michael
More information about the seaside-dev
mailing list