Wednesday, January 19, 2011

af:poll interval manipulation

Introduction
af:poll is an ADF Faces Component that periodically polls the Middle Tier webserver and does a post back.

UseCase
Say, we have an ADF page with an af:poll that queries some data from the underlying DB table.We want the poll to happen in 5 seconds as soon as page loads and brings the data to the UI.After that we want the poll to happen after 3 minutes(Say).

Code
<af:poll id="p2"
interval="#{adfFacesContext.postback == false ? 5000 : 180000}"
immediate="true"
clientComponent="true"
</af:poll>

No comments: