4 Replies Latest reply on Jan 13, 2009 4:06 PM by diet ice

    Progressbar not displayed

    Thomas Delhoménie Newbie

      Hi,

      I've got a problem when using progressbar component. The progress bar is only displayed when the max value is reached. I want the progress bar to be displayed when I click on the a4j:commandButton and see the value increase.

      Here is my jsp :

      <a4j:commandButton actionListener="#{transfertDocsBackingBean.doTransfert}"
       value="Transférer"/>
      
       <rich:progressBar id="progressBar" value="#{transfertDocsBackingBean.nbDocsProcessed}"
       interval="2000" label="#{transfertDocsBackingBean.nbDocsProcessed}"
       enabled="true" minValue="0" maxValue="#{transfertDocsBackingBean.nbDocsToMove}">
       </rich:progressBar>



      and my backing bean :
      public class TransfertDocsBackingBean {
      ...
       public int getNbDocsProcessed() {
       return nbDocsProcessed;
       }
      ...
       public void doTransfert(ActionEvent event) {
      ...
       nbDocsToProcess = 100;
       for(int i = 0; i < nbDocsToProcess; i++) {
       Thread.sleep(500);
      
       this.nbDocsProcessed = i+1;
       }
      ...
      }