1 Reply Latest reply on Jul 21, 2008 5:19 AM by mail.micke

    need a way to prime a4j:poll

    irun5k

      Some of my data on my page gets updated on the server at a low frequency. Therefore, I may have my a4j:poll interval set to something like 10 minutes.

      The problem with this is that I don't get a priming call- so when the user first loads my page, it takes 10 minutes for them to ever see the initial data.

      I tried using a session scoped bean to supply the interval dynamically. The first time the page asks for it, I make it return 500ms. After this, I bump the value via some code in my getter to 10 minutes. This works great, except, if the user reloads the page, I'm back to square one since the refresh is still 10 minutes and my data has disappeared.

      How can I get around this? I can probably do something with onload, but I'm not clear how to create a body onload function since I'm using richfaces + facelets and the concept of <body onload...> doesn't exist in the context.

      Otherwise, it would be nice to be able to tell a4j:poll that the first poll should start at 0, and the next one at 0+interval. But for now, I just need a workaround. Any ideas?

      Thanks