0

How do I push some change to a webapp page in a tab/window due to an action in another window/ tab(for e.g. an action like user login)? Is it possible to do ?

Rajat Gupta
  • 25,853
  • 63
  • 179
  • 294

1 Answers1

0

Without client request, the server cannot send something to the client. idleMonitor is a primefaces component that fires a client request after sometime and kicks an event on the server to reply back. You can use that event to check the changes and respond to the client. However, the time is static and should be predefined.

poll is another primefaces component that fires a client request for every defined interval. e.g 5 sec. However, you might consider the negative side of it of sending many empty requests for every client to the server.

Additional:

There are some complex workarounds known as comet or long polling that instantly submit changes to the client. (as in facebook notification)

see this answer for more details.

Community
  • 1
  • 1
fareed
  • 3,034
  • 6
  • 37
  • 65