Whenever an html action event is triggered from the browser and if smart refresh or similar is used, we see a progress indicator spinner running. In some cases where the response time is longer, I want to add the flexibility for the users to be able cancel the request and proceed.
How cac this be achieved.
DGawron 10000054HC50 Posts
Re: Cancel a Ajax request2012-11-28T15:57:14ZThis is the accepted answer. This is the accepted answer.Cancelling a smart refresh request (or any HTTP request for that matter) is much more complicated than it first appears. My recommendation is to make the target action / page response fast enough so that users don't need a "cancel" option.
The usual cause of slow refresh behavior is slow access to some back-end or trying to perform too many back-end operations per request. Do everything you possibly can to make back-end access fast. This involves using paged access to results, caching where appropriate, reducing the amount of data accessed and returned for each page, refreshing smaller portions of a page, off-loading back-end access to an ESB, etc.
While cancelling the spinner is technically possible (but undocumented from what I can tell), that's not the hard problem. The hard problem is cancelling the running HTTP request and rolling back changes to the back-end(s) and the model state.
HSSH_Sandip_Kulkarni 270003HSSH13 Posts
Re: Cancel a Ajax request2012-12-10T11:58:07ZThis is the accepted answer. This is the accepted answer.
- DGawron 10000054HC
What would be the suggestions to
- cancel the spinner
- cancel the http Ajax request itself
kevintap 100000QN039 Posts
Re: Cancel a Ajax request2012-12-11T17:00:28ZThis is the accepted answer. This is the accepted answer.
- HSSH_Sandip_Kulkarni 270003HSSH
The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.