0 Replies Latest reply on Apr 9, 2010 11:10 AM by damendra

    Getter Called Multiple Times When Using <a4j:poll>

    damendra Newbie


      I have been using <a4j:poll> to render a segment of a .xhtml page but the underlying bean getter method is being called multiple times, potentially causing a performance issue but also unexpected behaviour.

      The code is as following

           <a4j:poll id="poll" interval="2000" enabled="true" reRender="numberGrid" />
         <h:outputText id="numberGrid" value="#{number}" />
      public class RandomNumber() {
          private int number;
          public getNumber(){
            Random random = new Random();
            number = random.nextInt(12);
            return number;

      Can anyone help explain and throw some light on an alternative solution?