2.13. Deactivation of the Ajax Loading Mask

The loading mask layer is deployed after an ajax-call. It aims at blocking the GUI to prevent further user actions until the the ajax-request has been completed.

However, the mask layer may need to be deactivated in instances where the portal requires user instructions before the previous instructions have been carried out.

Deactivating the Ajax Loading Mask

Simply generate a script to make an asynchronous ajax-call. Use the uicomponent.doAsync() method rather than the uicomponent.event() method. For example:

<a href="<%=uicomponent.doAsync(action, beanId, params)%>" alt="">Asynchronous</a>

Synchronous issue

Most web browsers support Ajax requests in two modes: Synchronous and Asynchronous. This mode is specified with a boolean bAsync parameter.

var bAsync = false; // Synchronous
request.open(instance.method, instance.url, bAsync);

However, to work with browsers that do not support the Synchronous requests, bAsync is always set to true (Ajax request will always be asynchronous).

// Asynchronous request
request.open(instance.method, instance.url, true);
Copyright ©. All rights reserved. eXo Platform SAS
blog comments powered byDisqus