Igor,
I had a feeling that was the situation. I'll take a closer look at my
code with that in mind and if I can come up with a clear follow up
question, I'll post some relevant excerpts.
Thanks very much for your help,
James.
Igor Vaynberg wrote:
the short answer is: you cant do that.
So although clearly AJAX is supposed to be mostly asynchronous. it looks
like the underlying XMLHttpRequest object _can_ be synchronous.
If I modify wicket-ajax.js and set 'Wicket.Ajax.Request.async' to
*false* -- suddenly my code works... i.e. I can code an
AjaxFormSubmitBehavor.onSubmit so
if you change wicket-ajax.js in the way you showed below then all ajax
requests will become synchronous. while you wont break anything foundamental
you will make parallel ajax requests impossible. not a good thing imho. i
guess we need to add a parameter so that you can set the request to
Good point. What I'm planning on is to inject my own ResourceReference
version with the async set to false, but only for the one page where I
need it to be synchronous. Since I'm overriding
onRenderHeadInitContribution, I can just choose not to call super and
the default .js files won't get
feel free to add an rfe into our jira for the extra param.
-igor
On 5/4/07, James Renfro [EMAIL PROTECTED] wrote:
Good point. What I'm planning on is to inject my own ResourceReference
version with the async set to false, but only for the one page where I
need it to be synchronous. Since I'm
the short answer is: you cant do that. javascript is asynchronous, so the
request will start _and_ your function will continue running. usually what
is done is that you create a request object, and then register success and
failure handlers that are executed after the request is done.
you can do