14 Replies Latest reply on Oct 19, 2008 1:12 PM by nimo stephan

    <rich:progressBar actualValue does not work within for-loop

    nimo stephan Master

      Look at my progressBar:

      <rich:progressBar value="#{myBean.actualValue}"
       interval="1000" label="#{myBean.actualValue} %"
       minValue="-1" maxValue="1000">
      </rich:progressBar>


      The actualValue is caluculated within a for-loop (in my managedBean):

      
      public void doJob() {
      
      for (int i=1; i<= 10000; i++)
      {
      // current value of ProgressBar
      this.setActualValue(i);
      }
      
      }


      Unfortunately, this does NOT work!

      When I set the actualValue NOT in a scope of the for-loop, then it works!

      For example:

      public void doJob() {

      // current value is calculated out of scope of my for-loop
      this.setActualValue(this.setActualValue+1);

      for (int i=1; i<= 10000; i++)
      {
      ...
      }

      }