Another way would be to disable the UI component immediately the user clicks on it. Then after the server requests have been completed to then enable that component.
If one click fires off multiple requests then you will need a mechanism that can detect when the last request has finished. This can be done in different ways. The first would be to fire off the first request, then when complete fire off the next request and so on until the last request has finished. Another way would be to fire the requests then keep a count of the finished ones, then when all have finished to enable he control. Another way maybe to group all requests into one super request, and have one return result. Andrew --- In [email protected], Ray Horn <[EMAIL PROTECTED]> wrote: > > I too ran into this sort of problem however I chose to build a REST Serialization mechanism that guarantees I can queue-up requests as deep as I need and then execute them serially since that is the way my REST backend needs the requests in order to maintain database state. > > > ----- Original Message ---- > From: coderdude2 <[EMAIL PROTECTED]> > To: [email protected] > Sent: Saturday, April 7, 2007 5:05:02 PM > Subject: [flexcoders] Sending multiple HTTPService requests - how to really cancel all but the last > > I'm using several HTTPService calls to plain old REST API's on the > backend. > > If the end user clicks some of the UI controls multiple times quickly, > many calls to these services get queued up, and it can take a long > time for all the data to be retrieved. > > For ex. clicking on a list box item sends requests to refresh all the > data, and if the user were to use the keyboard to quickly scroll > through the listbox, many many calls would get queued up. > > I've tried setting the concurrency= "last" on the httpservices, but it > appears the only effect of that is to make the UI change only when the > last dataset is received, but still all the service calls continue to > be queued and there is a long delay after making many calls. > > I've also tried <httpservice> .disconnect( ) and .cancel() before making > any new backend call but it didn't appear to have any effect as far as > preventing many calls from getting queued up. > > Thanks in advance for any ideas. I know I could also look into > retrieving all the data only once and doing local Flex filtering on it > rather than getting the data fresh from the backend each time, but for > now it's just easier to make the backend calls and use the DB to do > the proper filtering and querying. >

