There is however a timeout value defined in the XPages client side runtime environment, that prevents event code from running too long (the default limit is about 6 seconds).
If a piece of code exceeds this duration, the browser displays a timeout alert message to indicate that a Dojo Ajax call did not return a result within the allowed period of time.
To increase the timeout value, simply add the following script block to the source code of an XPage:
//increase Ajax request timeout to 600 seconds
XSP.submitLatency = 600 * 1000;