> You just call to create it > before your RPC/runAsync call, and then to remove it on onSuccess and > onFailure
Yes, that's how its done and I'm doing it more or less the same way. Consider this example: You have several components in a panel, each of which can trigger an async call. You want to activate a shared busy indicator for any async activity. You are forced to write the same code in many places. Doing this is not a big task but maintaining it would be tedious, sooner or later, inconsistencies would crop up. So the point is to do it in a single place just once...or once per each logical component. > That one or more RPC calls are in progress > does not imply necessarily that a waiting dialog should be showing. Agree. I wasn't talking about having GWT display the loading indicator. But some event capturing mechanism that could be applied like an aspect if one wanted. I was talking about getting access to async call status and events by registering in a single place. Instead of having to write additional code in 2 places for each call just to be able to catch the events. If we could get these events or be able query gwt about status of calls made through its RPC mechanism, it would simplify many use cases. Thanks for your comments. Regards, Priyank On Apr 2, 12:04 am, kozura <[email protected]> wrote: > This isn't in GWT because this is not a simple generic problem that > can be solved universally. That one or more RPC calls are in progress > does not imply necessarily that a waiting dialog should be showing. > For example say I have a page with several panels that each separately > make an RPC call to fetch some data. If one comes back, why not fill > it and allow the user to interact with it while the others still > load? No need to freeze the whole app. In this case, maybe each > panel can have a "Loading..." message that gets changed to good GUI > stuff once the data arrives. > > That said, it's fairly easy to create your own generic class that can > bring up a wait dialog when you do need to wait for something; I have > one for my runAsync calls because when I'm waiting for code to load I > really don't want any other interaction. You just call to create it > before your RPC/runAsync call, and then to remove it on onSuccess and > onFailure. Better still is to have a cancel button on it which can be > checked and handled in onSuccess. But I'd be leery trying to make one > work automatically for all calls, as you are unnecessarily crippling > your user experience. > > On Apr 1, 11:59 am, spacejunkie <[email protected]> wrote: > > > I think Vik is looking for some API which can globally monitor async > > calls and fire events. > > Such global events can be used to display or hide busy indicators. > > > Writing code for busy indicator for each async call creates clutter. > > Besides if the same busy indicator is > > shared by multiple async calls, one has to write additional logic to > > handle concurrent async calls - > > for example if one call finishes but other is still in progress and if > > the callback simply hides the indicator then the first callback would > > hide the indicator and mislead the user into believing that all > > processes are complete. > > > The state of each call has to be monitored in this case. This isn't > > too difficult, but having to replicate same code in every call doesn't > > feel right. > > > There should be an event or some hook into GWT internals that can tell > > if any async call is in progress. > > I would like to hear some thoughts on this. > > > I have searched a lot and haven't found any API support to do this. > > This is a big feature missing in GWT. > > If I'm missing out something please point out. > > > Regards, > > Priyank > > -- 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.
