Wednesday, September 14, 2011

ADF A refreshing graph with a af:poll

I wanted to have my adf graph component refresh every 10 seconds or so to reflect the latest info.
I wasn't really interested in Active data to push the info to me when it changed as it changed too often.

So this is super simple and involved the following steps:

1) Drag on a poll component (Component pallet --> operations --> poll)


2) Add a partial trigger to your graph. ( partialTriggers="::poll1") where poll1 is the id of the poll component.

3) viola it just works.

Poll Properties
interval - How long in miliseconds between polls

timeout - Amount of time before the poll stops due to inactivity this will make sure a users session can timeout on this page due to inactivity as a poll is seen as activity (-1 infinite).

pollListener - Add some custom code to each poll event.
  public void yourPoll(PollEvent pollEvent) {

No comments:

Post a Comment