hi!
maybe somebody could help me with this. i'm trying to set the
"MediaStation" static variable "result" in an inner class,
unfortunately the the method "getXMLContent(...)" still returns the
initially set string "nothing" when calling it with:
---
Window.alert("Content: " + MediaStation.getXMLContent(XML_FILEPATH));
---
I also checked, that the inner method "onResponseReceived" is called
and "response.getText();" also returns a result (see the commended
alert window statement).
source follows:
---
...
public class MediaStation{
private static String result = "0";
...
public static String getXMLContent(String path){
RequestBuilder requestBuilder = new RequestBuilder
(RequestBuilder.GET, path);
MediaStation.result = "nothing";
try {
requestBuilder.sendRequest(null, new RequestCallback() {
public void onError(Request request, Throwable
exception) {
MediaStation.requestFailed(exception);
}
public void onResponseReceived(Request request,
Response response)
{
MediaStation.result =
response.getText();
//Window.alert("XML file successfully
read: " +
MediaStation.result);
}
});
} catch (RequestException ex) {
MediaStation.requestFailed(ex);
}
return MediaStation.result;
}
...
}
---
thanks for your help! bye!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---