2

when creating an new qx.data.store.Jsonp object like this...

var store = new qx.data.store.Jsonp(url, {
  configureRequest: function(req) {
    req.setParameter("key", "resources.appsrvs");
  }
},"callback");

... the delegate function configureRequest does not get the request as parameter as described in qx.data.storeInterface.IStoreDelegate. so how can i configure the request?

skaffman
  • 398,947
  • 96
  • 818
  • 769
mika26
  • 21
  • 4

2 Answers2

3

Unfortunately, not in the way you intend. The Jsonp store uses a ScriptLoader object, as it is designed for cross-domain requests. So your delegate is used, but the 'req' object passed to it is actually a qx.io.ScriptLoader instance. Please see the API doc for ScriptLoader and also here for some additional details.

If you are not planning to do a cross-domain request, consider using qx.data.store.Json instead.

ThomasH
  • 22,276
  • 13
  • 61
  • 62
  • 1
    Unfortunately i am planning to make an cross domain request. But I found no way to "req.setParameter" via "ScriptLoader". As workaround I add the parameter by string concatenation to the url (url+"?key=resources.appsrvs"). Not nice, but works. So I have to care about url-escaping myself. – mika26 Mar 24 '10 at 09:01
1

It might have something to do with the fact that qx.data.store.Jsonp internally seems to use qx.io.ScriptLoader for which the documentation says EXPERIMENTAL – NOT READY FOR PRODUCTION.

Also you didn't specify which version of qooxdoo you use. Prior to 1.0.x I think qx.data.store.Jsonp is just an empty stub.

Does your function get called at all? If yes what does it get passes as parameters?

And finally consider just filing a bug report.

jitter
  • 53,475
  • 11
  • 111
  • 124