ProgressBar Primefaces Erro no Css

0 respostas
b10machado

Não ta pegando o gif :S na hora q carrega!! :s alguem pode me ajudar. Obrigado

//Cascata/Folhas.css

* 
    Document   : Folha
    Created on : 22/07/2012, 23:53:47
    Author     : bruno
    Description:
        Purpose of the stylesheet follows.
*/

root { 
    display: block;
}
.animated .ui-progressbar {

   background-image: url("../Imagens/pbar-ani.gif"); 
}

==============================================
//Imagens/pbar-ani.gif

==============================================
<?xml version='1.0' encoding='UTF-8' ?>  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"  
      xmlns:h="http://java.sun.com/jsf/html"  
      xmlns:p="http://primefaces.org/ui"
      template="../templates/ui.xhtml">  
    <h:head>
        <link rel="stylesheet" type="text/css" href="Cascata/Folha.css"/>  
    </h:head>
    <h:body  >

        <h:form >
            <p:growl id="growl"/>

            <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="animated">  
                <p:ajax event="complete" listener="#{progressBean.onComplete}" 
                        update="growl" oncomplete="startButton2.enable()" />  
            </p:progressBar>

            <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>

        </h:form>
    </h:body>



</html> 
======================================
Bean

  
import java.io.Serializable;    
    
import javax.faces.application.FacesMessage;    
import javax.faces.bean.ManagedBean;  
import javax.faces.context.FacesContext;  
  
@ManagedBean(name = "progressBean")  
  
public class ProgressBean implements Serializable {    
    
    private Integer progress = 0;    
    
    public Integer getProgress() {    
        if(progress == null)    
            progress = 0;    
        else {    
           /* progress = progress + (int)(Math.random() * 52);    
                
            if(progress > 100)    
                progress = 100; */
            while(progress < 100){
                progress = progress+1;
            }
        }    
            
        return progress;    
    }    
    
    public void setProgress(Integer progress) {    
        this.progress = progress;    
    }    
        
    public void onComplete() {    
        FacesContext.getCurrentInstance().addMessage(null, 
                new FacesMessage(FacesMessage.SEVERITY_INFO, "Progress Completed", "Progress Completed"));    
    }    
        
    public void cancel() {    
        progress = null;    
    }    
}
Criado 23 de julho de 2012
Respostas 0
Participantes 1