Hi Claus,

Am 20.08.2010 10:15, schrieb Claus Straube:
> I'm trying to get a JSON object as model into my application. For my
> first case it's not relevant if the source is a webserver or my local
> file system (in the end scenario it must be a webserver).
>
> I read the twitter sample from qooxdoo an played around...
>
> the tutorial variant:
> var url = "http://twitter.com/statuses/friends_timeline.json";;
> this.__store = new qx.data.store.Jsonp(url, null, "callback");
>
> result -->  __store is "undefined", model is "null" (no error message)
I've just tried the provided URL and I get no result from twitter. Is 
this service still valid for Twitter, since they changed the usage of 
their service. I guess you have to use the OAuth mechanism to get data 
from Twitter.

> my webserver variant:
> var url = "http://localhost/demo/processes/testprocess_01.json";;
> this.__store = new qx.data.store.Json(url);
>
> result -->  __store is "undefined", model is "null" (no error message)
Do you get any error in the firebug console? Do you already tried the 
URL with your browser to be sure that valid JSON is returned?

> my file system variant:
> var url = "/var/www/demo/processes/testprocess_01.json";
> this.__store = new qx.data.store.Json(url);
>
> result -->  __store is "undefined", model is
> "null" (qx.io.remote.transport.XmlHttp[51]: Could not load from
> file: /var/www/demo/processes/testprocess_01.json)
This is a issue with SOP (Same Origin Policy). The browser does not 
allow to read URLs which are not located in the same directory.


> I'm using qooxdoo 1.2 and we're here behind a proxy server (perhaps this
> is relevant).
Maybe, the best idea I have to check the URLs in your browser first to 
validate that the result is correct.

> By the way if I try to generate the model directly from JSON I'm getting
> the model without problems:
>
> var model = qx.data.marshal.Json.createModel({
>               processName: "TESTPROCESS",
>               processVersion: "1.2",
>               processDescription:
>               ...

It seems that the URLs you provide do not return the right result.

cheers,
   Alex

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to