0 Replies Latest reply on Nov 8, 2008 3:57 PM by hurzeler

    ProgressBar Server side LiveDemo does not work as it should

    hurzeler

      Have you noticed that the ProgressBar http://livedemo.exadel.com/richfaces-demo/richfaces/progressBar.jsf does not work as it should.

      The

      <h:outputText value="Process doesn't started yet" />
      does not actually render.

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:a4j="http://richfaces.org/a4j"
       xmlns:rich="http://richfaces.org/rich">
      
       <h:form>
       <a4j:outputPanel id="progressPanel">
       <rich:progressBar value="#{progressBarBean.currentValue}"
       interval="2000" label="#{progressBarBean.currentValue} %"
       enabled="#{progressBarBean.enabled}" minValue="-1" maxValue="100"
       reRenderAfterComplete="progressPanel">
       <f:facet name="initial">
       <br />
       <h:outputText value="Process doesn't started yet" />
       <a4j:commandButton action="#{progressBarBean.startProcess}"
       value="Start Process" reRender="progressPanel"
       rendered="#{progressBarBean.buttonRendered}"
       style="margin: 9px 0px 5px;" />
       </f:facet>
       <f:facet name="complete">
       <br />
       <h:outputText value="Process Done" />
       <a4j:commandButton action="#{progressBarBean.startProcess}"
       value="Restart Process" reRender="progressPanel"
       rendered="#{progressBarBean.buttonRendered}"
       style="margin: 9px 0px 5px;" />
       </f:facet>
       </rich:progressBar>
       </a4j:outputPanel>
       </h:form>
      </ui:composition>
      


      The solution is simple. Use
      <h:panelGroup>
      .

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:a4j="http://richfaces.org/a4j"
       xmlns:rich="http://richfaces.org/rich">
      
       <h:form>
       <a4j:outputPanel id="progressPanel">
       <rich:progressBar value="#{progressBarBean.currentValue}"
       interval="2000" label="#{progressBarBean.currentValue} %"
       enabled="#{progressBarBean.enabled}" minValue="-1" maxValue="100"
       reRenderAfterComplete="progressPanel">
       <f:facet name="initial">
       <h:panelGroup>
       <br />
       <h:outputText value="Process doesn't started yet" />
       <a4j:commandButton action="#{progressBarBean.startProcess}"
       value="Start Process" reRender="progressPanel"
       rendered="#{progressBarBean.buttonRendered}"
       style="margin: 9px 0px 5px;" />
       </h:panelGroup>
       </f:facet>
       <f:facet name="complete">
       <h:panelGroup>
       <br />
       <h:outputText value="Process Done" />
       <a4j:commandButton action="#{progressBarBean.startProcess}"
       value="Restart Process" reRender="progressPanel"
       rendered="#{progressBarBean.buttonRendered}"
       style="margin: 9px 0px 5px;" />
       </h:panelGroup>
       </f:facet>
       </rich:progressBar>
       </a4j:outputPanel>
       </h:form>
      </ui:composition>
      


      Hopefully that helps some of you...

      It would have saved me an afternoon.