Hi,

as I see it

Wicket.Ajax.getTransport

sometimes returns XMLHttpRequest objects that are in "readyState == 4"
so they still might be processed by the "stateChangeCallback".

Once "stateChangeCallback" reaches "t.onreadystatechange = Wicket.emptyFunction;"

the freshly created XMLHttpRequest never calls back, the Channel its been asigned to
never reaches "done" the Channel is dead.

To resolve that I came up with this patch.
Not quite shure if it introduces more problems than it solves:-)
Esp. I cant tell if XMLHttpRequest.abort() sets back the readyState back to 0 on all browsers.

mf


Index: jdk-1.4/wicket/src/main/java/wicket/ajax/wicket-ajax.js
===================================================================
--- jdk-1.4/wicket/src/main/java/wicket/ajax/wicket-ajax.js (Revision 518505) +++ jdk-1.4/wicket/src/main/java/wicket/ajax/wicket-ajax.js (Arbeitskopie)
@@ -403,7 +403,7 @@
                       this.busy = true;
                       return callback();
               } else {
-                       Wicket.Log.info("Chanel busy - postponing...");
+                       Wicket.Log.info("Channel busy - postponing...");
                       if (this.type == 's') // stack
                               this.callbacks.push(callback);
                       else /* drop */
@@ -487,7 +487,7 @@
       getTransport: function() {
               var t = Wicket.Ajax.transports;
               for (var i = 0; i < t.length; ++i) {
-                       if (t[i].readyState == 0 || t[i].readyState == 4) {
+                       if (t[i].readyState == 0) {
                               return t[i];
                       }
               }
@@ -713,7 +713,7 @@
this.done(); this.failure(); } - t.onreadystatechange = Wicket.emptyFunction;
+               t.abort();
this.transport = null; } }

Reply via email to