2 Replies Latest reply on Nov 10, 2010 3:53 PM by robertgary1

    Short circuit a4j:poll

    robertgary1

      I have a poll every 5 seconds to update regions of my page. However, often times the back end knows that the data hasn't changed. How can I use a4j:poll so that I can abort an update if the backend found no changes? This helps prevent flashing or scoll bar movement when nothing changed.

      Could I have a backing bean attribute #pollBean.noChanges that I could refernece in onbeforedomupdate() and return something to tell the poll to not update the DOM?

       

      -Robert

        • 1. Re: Short circuit a4j:poll
          ilya_shaikovsky

          You could bind the reRender to some bean property which hold's id's for reRender. It should return "" when no changes found. It will be more optimal because in that case content will not be rendered and passed to client.

           

          B.t.w. maybe push will be more suitable? Check livedemo sample with the dataTable.

          • 2. Re: Short circuit a4j:poll
            robertgary1

            Thanks. That seems to be working. For clarification though; I always need to rerender the area that contains the a4j:poll tag otherwise the reRender bean property would not be available, correct?

             

             

            -Robert