Serialized partial refresh calls V1.0.1


if (!XSP._inheritedPartialRefresh) {
	XSP._inheritedPartialRefresh = XSP._partialRefresh;
	XSP._partialRefreshQueue= [];
	XSP._canSubmit= XSP.canSubmit;

	XSP.canSubmit= function() {
		return true; // can always submit
	};

	XSP._partialRefresh = function(method, form, refreshId, options) {
		this._partialRefreshQueue.push([method, form, refreshId, options]);
		if(XSP._partialRefreshQueue.length<=1)
			setTimeout(XSP._partialRefreshProcess, 100);
	};
	
	XSP._partialRefreshProcess= function() {
		if(XSP._partialRefreshQueue.length==0)
			return;
		var arguments= XSP._partialRefreshQueue[0];
		// Publish init
		dojo.publish('partialrefresh-init', arguments);
		XSP._inheritedPartialRefresh.apply(XSP, arguments);
		XSP.allowSubmit();
	};

	dojo.subscribe('partialrefresh-end', function() {
		XSP._partialRefreshQueue.shift();
		if(XSP._partialRefreshQueue.length)
			setTimeout(XSP._partialRefreshProcess, 100);
	})
}
All code submitted to OpenNTF XSnippets, whether submitted as a "Snippet" or in the body of a Comment, is provided under the Apache License Version 2.0. See Terms of Use for full details.
1 comment(s)Login first to comment...
Fredrik Norling
(at 13:26 on 12.08.2018)
It might be a conflict if one is using my standby dialog snippet because this is also using http://dontpanic82.blogspot.fr/2010/01/xpages-hijackingpublishing-partial.html