Hello there,
I am looking for a way to automate showing and hiding a 'loading' message when calling an async service, so instead of doing this:
showLoadingWidget();
service.getShapes(dbName, new AsyncCallback() {
public void onSuccess(Shape[] result) {
hideLoadingWidget();
// more here...
}
public void onFailure(Throwable caught) {
hideLoadingWidget();
//more here
}
});
I'd like to do just this, but still show and hide the message at completion.
// this should be gone: showLoadingWidget();
service.getShapes(dbName, new AsyncCallback() {
public void onSuccess(Shape[] result) {
// this should be gone: hideLoadingWidget();
// more here...
}
public void onFailure(Throwable caught) {
//this should be gone: hideLoadingWidget();
//more here
}
});
In short I would like to change the behavior of the async calls. Thank you for all the possible suggestions.
Daniel