TechChain
TechChain

Reputation: 8944

Using ajax status for single ajax request in primefaces

I am sending multiple ajax request in PrimeFaces. I have used <p:ajaxStatus /> component to show loading dialog. I am performing CRUD operation in PrimeFaces. So all CRUD operations are using ajax request. So whenever i am performing any CRUD operation loading dialog is shown. Where as i just want to show Loading dialog only for DELETE operation.

So is there any way that i can prevent ajax status for a particular request?

Upvotes: 1

Views: 1177

Answers (1)

Kukeltje
Kukeltje

Reputation: 12337

Think the other way around…

"How can I show a dialog when a command starts and hide it when it end"

The answer is very simple then. Use the onstart and oncomplete attributes of the single commandbutton to show/hide a specific dialog. You can customize that one specific dialog in any way you want.

You can also use a p:blockUI as correctly stated in the comments

The ajaxstatus is a kind of optimization if you want it for all requests. In this case you want it for one request. So don't use the onstart and oncomplete of an ajaxstatus then.

Upvotes: 3

Related Questions