3 Replies Latest reply on Jul 30, 2008 9:56 AM by jsage

    Change interval of a4j:poll?

    pinaev

      I need to be able to poll every 60 seconds. However, when I specify the interval at 60 seconds and render the page, the first polling occurs only after 60 seconds. I need it to happen right after the page is loaded and only then every 60 seconds. If there a way to achieve this?

      It would be nice if the pool was not bound to a backend component... Perhaps there is a way to change the interval of an "a4j:poll" on the client side using javascript...

      Thanks!

        • 1. Re: Change interval of a4j:poll?
          pdpantages

          Hello pinaev,

          Could you use the window.onload?

          E..g,

          <script type="text/javascript">
           window.onload = whateverThePollDoes;
          </script>
          


          Then create the javascript f(), possibly with a4j:jsFunction:
           <a4j:region>
           <a4j:jsFunction
           name="whateverThePollDoes"
           reRender="whatever the poll renders"
           action="#{whatever.the.poll.action.is}" >
           </a4j:jsFunction>
           </a4j:region>
          


          PdP

          • 2. Re: Change interval of a4j:poll?
            jsage

            Using polling worked for my problem with the selectManyPicklist control.

            Thanks pinaev for forwarding this message.

            • 3. Re: Change interval of a4j:poll?
              jsage

              Sorry, I should have thanked pdpantages for forwarding this message to me. Using polling worked.

              Thanks pdpantages!