JSF Animated Please Wait Popup for Ajax Requests

JSP code for your page:

..header
<a4j:form id="a4jF" ajaxSubmit="true">
   <a4j:queue id="a4jQ" requestDelay="0"
   ignoreDupResponses="true"
   oncomplete="if(request.queue.getSize()==0){hidePleaseWait();}" />
   ... your page content
   <a4j:status id="a4jS" onstart="showPleaseWait();" />
</a4j:form>
..footer

JSP code for Please Wait modal panel:

<rich:modalPanel id="pleaseWaitModalPanel" autosized="true" tridentIVEngineSelectBehavior="hide">
		.. your please wait content
</rich:modalPanel>

Javascript code:

function showPleaseWait() {
	var browser = navigator.appName;
	if (browser == "Microsoft Internet Explorer") {
		 document.body.style.cursor = 'wait';
	} else {
		Richfaces.showModalPanel('pleaseWaitModalPanel');
	}
}

function hidePleaseWait() {
	var browser = navigator.appName;
	if (browser == "Microsoft Internet Explorer") {
		document.body.style.cursor = 'default';
	} else {
		Richfaces.hideModalPanel('pleaseWaitModalPanel');
	}
}

Requirement Engineering, Business Analysis, Agile, Analysis and Design with UML, Java/J2EE, Liferay, Javascript, Embedded C++, MDD, Executable UML, Project Management


© 2017 JULIUSURBAN.NET