Progress bar com problema

0 respostas
b10machado
<h:form> 
                <p:commandButton value="Start" type="button" onclick="pbAjax.start();startButton2.disable();" widgetVar="startButton2" />  
                <p:commandButton value="Cancel" actionListener="#{progressBean.cancel}" oncomplete="pbAjax.cancel();startButton2.enable();" />  

                <p:progressBar widgetVar="pbAjax" ajax="true" value="#{progressBean.progress}" labelTemplate="{value}%" styleClass="">  
                    <p:ajax event="complete" listener="#{progressBean.onComplete}" oncomplete="startButton2.enable()"/>  
                </p:progressBar>  
            </h:form>
            
            <script type="text/javascript">  
    function start() {  
        startButton1.disable();  
        window['progress'] = setInterval(function() {  
            var oldValue = pbClient.getValue(),  
            newValue = oldValue + 10;  
  
            pbClient.setValue(pbClient.getValue() + 10);  
  
            if(newValue == 100) {  
                clearInterval(window['progress']);  
            }  
  
  
        }, 1000);  
    }  
  
    function cancel() {  
        clearInterval(window['progress']);  
        pbClient.setValue(0);  
        startButton1.enable();  
    }  
</script>

clico e nd acontece, ja na pagina do primefaces vai certinho!!!

Criado 19 de julho de 2012
Respostas 0
Participantes 1