-
1. Re: How to abort an ajax request that use a4j:queue
ilya_shaikovsky Jan 22, 2010 5:38 AM (in response to ronanker)I'm wondering why timeout not works for you? It just does the same thing you describing. -
2. Re: How to abort an ajax request that use a4j:queue
ronanker Jan 22, 2010 6:21 AM (in response to ilya_shaikovsky)Timeout on queue is a cool feature that we already use. But we have set a long timeout (says 1 minute) and some users don't want to wait so long.
So we try another way: after a shorter timeout (says 20 secs), we popup a confirm box saying:
"The transaction seems take too long (perrhaps there is network problem), would you like to abort it (click on 'Ok') or would you like to wait a little more (click on cancel)'
If the user click on 'ok', the javascript will abort immediatly the pending request not waiting the timeout.
Furthermore, in case of timeout or aborted request, what is the best practise to synchronize the browser page with view in the server ? (at the moment, we are reloading the page) ?
Thanks.
-
3. Re: How to abort an ajax request that use a4j:queue
ilya_shaikovsky Jan 22, 2010 7:01 AM (in response to ronanker)Unfortunatelly we curently do not have such api. So seems the only way is to set the timeout to smaller value. Thanks for bringing this it would be good feature to include while planning api for 4.x.1 of 1 people found this helpful -
4. Re: How to abort an ajax request that use a4j:queue
ronanker Jan 22, 2010 10:22 AM (in response to ilya_shaikovsky)Ok,
thanks anyway.
-
5. Re: How to abort an ajax request that use a4j:queue
ronanker Jan 29, 2010 3:33 AM (in response to ronanker)Alternatively, you could be a good idea to add an option in richfaces to retry to send the "timeouted" request.
When the timeout fires, the confirm box shows up and it is asked to the user if he wants to relaunch the failed request.
By the way, have you ever heard of ajax request hanging ?
This drives our users crazy !!