views:

83

answers:

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?

+1  A: 

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
oh, sorry. i am using 1.0.1, and it is called. see other answer.
mika26
+3  A: 

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
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