imo i did everything according to the tutorial here Googles x-site
/**
* Make call to remote server.
*/
public native static void getJson(int requestId, String url,
StockWatcher handler) /*-{
var callback = "callback" + requestId;
// [1] Create a script element.
var script = document.createElement("script");
script.setAttribute("src", url+callback);
script.setAttribute("type", "text/javascript");
// [2] Define the callback function on the window object.
window[callback] = function(jsonObj) {
// [3]
[email protected]::handleJsonResponse(Lcom/google/gwt/core/client/JavaScriptObject;)(jsonObj);
window[callback + "done"] = true;
}
// [4] JSON download has 1-second timeout.
setTimeout(function() {
if (!window[callback + "done"]) {
[email protected]::handleJsonResponse(Lcom/google/gwt/core/client/JavaScriptObject;)(null);
}
// [5] Cleanup. Remove script and callback elements.
document.body.removeChild(script);
delete window[callback];
delete window[callback + "done"];
}, 1000);
// [6] Attach the script element to the document body.
document.body.appendChild(script);
}-*/;
but it keeps failing me.. all other methos are also written.. i just can understand why it tells me every time that "Couldn't retrieve JSON" (it tells that when handler's input is null)
btw i am talking about the "3. Requesting the data from the remote server" on the googles site