try {
/*
* wait #timeout seconds for the request to complete
*/
builder.setTimeoutMillis(SettingsDialog.requestTimeoutSeconds * 1000);
Request response = builder.sendRequest("data=" + URL.encodeComponent(postData), new RequestCallback() {
public void onError(Request request, Throwable exception) {
if (exception instanceof RequestTimeoutException) {
RootPanel.get().remove(indicator);
com.google.gwt.user.client.Window.alert("Timeout");
}
else {
RootPanel.get().remove(indicator);
com.google.gwt.user.client.Window.alert(exception.toString());
}
}
public void onResponseReceived(Request request, Response response) {
RootPanel.get().remove(indicator);
new XHRresponseHandler(response.getText(), path);
}
});
} catch (RequestException e) {
RootPanel.get().remove(indicator);