O'Reilly logo

JBoss RichFaces 3.3 by Demetrio Filocamo

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

Push

The a:push component simulates push data from the server. It sends (according to the interval attribute) a very small, (and fast) non-JSF request to the server, in order to check if there are new messages in the queue and if this is true, it performs a standard JSF request.

Example code:

<a4j:push
reRender="myComponent"
interval="3000"
eventProducer="#{messageBean.addListener}" />

In this example, it will check in every 3 seconds (3000 milliseconds) whether there is a message in the queue. If so, the component with id = "myComponent" will be re-rendered.

The eventProducer attribute is needed to point at a method that accepts the PushEventListener instance and registers it, in order to use it inside the bean.

It can be very useful, for example, ...

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