JQAjax and done/fail/always

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

JQAjax and done/fail/always

jtuchel
Hi there,

I just stumbled upon a few strange effects with Callbacks in the context of Ajax calls coming back to my Seaside Server in an unexpected (and illogical order). I had been using the complete: parameter of an ajax.

The solution was to replace this code in my plugin:

$.ajax({
  "url": options.url,
  "data": [
    options.queryFields,
    options.serializeCallback+"="+self.val(),
  ].join("&"),
  "complete": drawTarget(),
});

with this code:

$.ajax({
  "url": options.url,
  "data": [
    options.queryFields,
    options.serializeCallback+"="+self.val(),
  ].join("&"),
}).always(drawTarget());

It seems like Seaside's JQAjax does not yet support/wrapper the done/fail/always methods of $.ajax.
Since I am using VA Smalltalk, I do not have the latest Seaside Version, but some derivative of 3.0.6. I wanted to check with Seaside 3.1, but I cannot load it into Pharo 2.0, so I thought I'd ask on this list:

Are there plans to support these Deferred-methods in Seaside (JQAjax, and maybe others) 3.1? Has anybody implemented a way to append these methods to $.ajax? I feel a bit helpless here...
I could solve the problem in my plugin on JS directly, but there are places where I'd like to use .always() within code that's rendered by Seaside...

Thanks for answering

Joachim