This is definitely not best practice, but sometimes there is a need to fire an Ajax request which might take a long time, I have just come across just such a situation. In XPages, the default timeout for Ajax requests is 20 seconds, after that you get an alert which says there was a problem and would you like to submit the whole page. But what if you need to exceed that?
Well it’s very simple really. Once the page loads, you just need to increase the timeout:
data-animation-override>
“XSP.submitLatency = 30000;”
The number is the timeout in milliseconds which you want to support.
As I said, not best practice, but if you ever need it, then simple to do.
I haven’t had a chance to really investigate it yet, but I’ve wanted to try web workers for this sort of scenario. From my very limited understanding it’s like a separate thread that goes off and does it’s own thing while the rest of the site continues to work and be functional without having to wait for the request to finish. Dunno if it’s feasible or actually fits this scenario but might be worth investigating.
In this case, Keith, I need the user to stay on the page and wait, but yes that would be an alternative approach.