fareed
fareed

Reputation: 3082

Primefaces Poll only if browser tab is focused

In implementing primefaces poll, I want to execute poll only if the browser tab is active/focused

Otherwise it should not poll data from backing bean as if multiple browser tabs are open, all the browser tabs will execute the poll regardless of being focused.

Upvotes: 0

Views: 946

Answers (1)

Kukeltje
Kukeltje

Reputation: 12337

Effectively, this question is a duplicate of a combination of two other questions. I'll answer it here anyway to emphasize the relevance (need!) to always try to break down your problem in more generic and hence manageable parts for which you can find answers. In this case the 'two' questions are:

Both are more easily solvable via search engines than the combined one.

I put the google searches behind the 'list items' above.

This results in

Which combined will give you the solution you need.

Upvotes: 1

Related Questions