O'Reilly logo

PrimeFaces Cookbook by Mert Çalışkan, Oleg Varaksin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Blocking page pieces during long-running AJAX calls

The BlockUI component allows us to block any piece(s) of a page during AJAX calls. Blocking is initiated by one or more trigger components. BlockUI adds a layer and any custom content over the target elements to be blocked and gives the appearance and behavior of blocking user interaction. It's very handy if you have, for example, a large data table, and sorting, filtering, pagination takes much time. You can block almost everything, even the entire page.

In this recipe, we will implement blockable p:panel and p:dataTable in order to learn all the features of p:blockUI.

How to do it...

The panel component in the following code snippet gets blocked when the command button is clicked and unblocked ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required