How can I centralize management of a "loading" icon for GWT async RPC calls? I'm looking for a way to have every async call automatically kick off a timer. When the timer fires, if the RPC has not yet completed, a "loading" icon should be displayed. When the RPC completes (either onSuccess()
or onFailure()
) the loading icon should be removed.
It's tedious to do this manually for each call, and in fact quite easy to get it wrong and leave the user with a stuck UI.
Could generators be used for this? Just to be clear- I'm not looking for code to display a dialog or icon; I'm looking for a way to centralize management of such a dialog/icon.