Ma page jsf n'affiche pas une liste

Fermé
khadijashili Messages postés 6 Date d'inscription samedi 11 juin 2016 Statut Membre Dernière intervention 6 septembre 2016 - 21 août 2016 à 12:54
Bonjour,
j'ai un problème dans l'affichage de ma page jsf ,lorsque j’exécute la page affiche un tableau vide et aucun erreur est afficher sur la console ci-joint le code j'espère que vous pouvez m'aider et merci d'avance.
ClassBean Demande:
package Com.fluide.controlleur;

import Com.fluide.model.Demande;
import Com.fluide.services.DemandeSerivce;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.PostConstruct;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;

@ManagedBean
@SessionScoped
public class DemandeController implements Serializable{
    @ManagedProperty(value ="#{demandServ}")
    private DemandeSerivce demandeSerivce;
    private Demande demande= new Demande();

    private List<Demande> listDemande = new ArrayList<Demande>();
    private List<Demande> listDem= new ArrayList<>();
    
    @PostConstruct
    public void init(){
    Random rn = new Random();
    int answer = rn.nextInt(1000000) + 1;
    demande.setIdDemande(answer);  
    }

     public void ajoutDemande (){
        try {
            demandeSerivce.addOrUpdate(demande);
            demande = new Demande();
            FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Ajout avec sucess", null));
        } catch (Exception ex) {
            FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Erreur d'Ajout", null));
            Logger.getLogger(DemandeController.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    public void  supprimeDemande (){
        try {
            demandeSerivce.delete(demande);
            FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Supprimer avec sucess", null));
        } catch (Exception ex) {
            FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Erreur de suppression", null));
            Logger.getLogger(DemandeController.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    
    public List<Demande> getListDemande() {
        try {
            listDemande = demandeSerivce.findAll();
        } catch (Exception ex) {
            Logger.getLogger(DemandeController.class.getName()).log(Level.SEVERE, null, ex);
        }
        return listDemande;
    }
 public List<Demande> getListDemandeById(){
     try {
         Criterion cri= Restrictions.idEq(444);
         
         listDem=demandeSerivce.findByCriteria(cri);
     } catch (Exception e) {
         Logger.getLogger(DemandeController.class.getName()).log(Level.SEVERE, null, e);
     }
        return listDem;
 }
    public void setListDemande(List<Demande> listDemande) {
        this.listDemande = listDemande;
    }


    public DemandeSerivce getDemandeSerivce() {
        return demandeSerivce;
    }

    public void setDemandeSerivce(DemandeSerivce demandeSerivce) {
        this.demandeSerivce = demandeSerivce;
    }

    public Demande getDemande() {
        return demande;
    }

    public void setDemande(Demande demande) {
        this.demande = demande;
    }

    public List<Demande> getListDem() {
        return listDem;
    }

    public void setListDem(List<Demande> listDem) {
        this.listDem = listDem;
    }
    
}
    

Class demande
package
Com.fluide.model;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


@Entity
@Table(name="demande"
    ,catalog="fluides"
)
public class Demande  implements java.io.Serializable {


     private int idDemande;
     private Client client;
     private String libelleDemande;
     private Date dateEnvoie;
     private String description;
     private Set<Intervention> interventions = new HashSet<Intervention>(0);

    public Demande() {
    }

	
    public Demande(int idDemande, Client client) {
        this.idDemande = idDemande;
        this.client = client;
    }
    public Demande(int idDemande, Client client, String libelleDemande, Date dateEnvoie, String description, Set<Intervention> interventions) {
       this.idDemande = idDemande;
       this.client = client;
       this.libelleDemande = libelleDemande;
       this.dateEnvoie = dateEnvoie;
       this.description = description;
       this.interventions = interventions;
    }
   
     @Id 
    @Column(name="idDemande", unique=true, nullable=false)
    public int getIdDemande() {
        return this.idDemande;
    }
    
    public void setIdDemande(int idDemande) {
        this.idDemande = idDemande;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="idClient", nullable=false)
    public Client getClient() {
        return this.client;
    }
    
    public void setClient(Client client) {
        this.client = client;
    }

    
    @Column(name="libelleDemande", length=254)
    public String getLibelleDemande() {
        return this.libelleDemande;
    }
    
    public void setLibelleDemande(String libelleDemande) {
        this.libelleDemande = libelleDemande;
    }

    @Temporal(TemporalType.DATE)
    @Column(name="dateEnvoie", length=10)
    public Date getDateEnvoie() {
        return this.dateEnvoie;
    }
    
    public void setDateEnvoie(Date dateEnvoie) {
        this.dateEnvoie = dateEnvoie;
    }

    
    @Column(name="description", length=254)
    public String getDescription() {
        return this.description;
    }
    
    public void setDescription(String description) {
        this.description = description;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="demande")
    public Set<Intervention> getInterventions() {
        return this.interventions;
    }
    
    public void setInterventions(Set<Intervention> interventions) {
        this.interventions = interventions;
    }
}

listeDemande.xhtml
<?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:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head>
        <title>liste demande</title>
    </h:head>
    
     <h:body>
             <h1   align="center" style="position: relative;
   
    color: #66CCDD;
    padding: 10px;
    margin: 75px 520px 10px 520px;"> Formulaire de la demande </h1>
        
         <p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" >
             <p:effect type="pulsate" event="load" delay="500" />
        </p:messages>
        <h:form id="f1">
            
        <p:commandButton value="Ajouter une demande" update=":edit:display"
                             onclick="PF('demandeAjout').show();" immediate="true" style="margin-left: 80px; margin-bottom: 30px" />
      
        <br/>
        <p:dataTable var="demande" value="#{demandeController.listDemandeById}" id="AjoutTab" widgetVar="demandeTable"
                 emptyMessage="No Account found with given criteria"  paginatorPosition="bottom"
                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                 rows="5" paginator="true" >
 
        <f:facet name="header">
            <p:outputPanel>
                <h:outputText value="Search all fields:" />
                <p:inputText id="globalFilter" onkeyup="PF('demandeTable').filter()" style="width:150px" placeholder="Enter keyword"/>
            </p:outputPanel>
        </f:facet>
            <p:column  id="iddemande" headerText="id " filterBy="#{demande.idDemande}" filterMatchMode="contains" >
                <h:outputText value="#{demande.idDemande}" />
        </p:column>
            <p:column id="nomdemande" filterBy="#{demande.libelleDemande}" headerText="Libellé" filterMatchMode="contains">
                <h:outputText value="#{demande.libelleDemande}" />
        </p:column>
        
            <p:column id="prenomdemande" filterBy="#{demande.description}" headerText="Description" filterMatchMode="contains">
                <h:outputText value="#{demande.description}" />
        </p:column>
        
           
            
            <p:column id="dateE" filterBy="#{demande.dateEnvoie}" headerText="date envoie" filterMatchMode="contains">
                <h:outputText value="#{demande.dateEnvoie}" />
        </p:column>
   <p:column >
                    <p:commandButton id="Editer" update=":Actualise:displaye" icon="ui-icon-arrowrefresh-1-w" oncomplete="PF('demandeEdit').show();" title="Editer">
                        <f:setPropertyActionListener target="#{demandeController.demande}" value="#{demande}"/>
                    </p:commandButton>     
       <p:commandButton id="Supprimer" icon="ui-icon-trash" title="Supprime" action="#{demandeController.supprimeDemande()}" update="AjoutTab">
                         <p:confirm header="Confirmation" message="Êtes-vous sûr?" icon="ui-icon-alert" />
                         <f:setPropertyActionListener target="#{demandeController.demande}" value="#{demande}"/>
                    </p:commandButton>
                </p:column>
            </p:dataTable>
        <p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
        <p:commandButton value="Oui" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
        <p:commandButton value="Non" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
        </p:confirmDialog>
        </h:form>
 
        <h:form id="edit">
 
            <p:dialog header="Ajout demande" widgetVar="demandeAjout" resizable="false" id="editP" modal="true">
                <h:panelGrid id="display" columns="2" cellpadding="4" >
                    <h:outputLabel for="id" title="Nom" value="id demande"/>
                    <p:inputText value="#{demandeControlleur.demande.idDemande}"   required="true" requiredMessage="id est obligatoire"/>
                    <h:outputLabel for="id1" title="Nom" value="Libellé" />
                    <p:inputText value="#{demandeControlleur.demande.libelleDemande}"   required="true"/>
                    <h:outputLabel for="prenomC" title="Nom"  value="Descriptiont:"/>
                    <p:inputText value="#{demandeControlleur.demande.description}"   required="true"/>
                    
                    <h:outputLabel for="dateE" title="Nom" value="Date Envoie"/>
                    <p:calendar value="#{demandeControlleur.demande.dateEnvoie}"   required="true"/>
                  
                    </h:panelGrid>
                <p:separator/>
                <p:commandButton value="Enregistrer" update=":f1:AjoutTab" action="#{demandeController.ajoutDemande()}" oncomplete="PF('demandeeAjout').hide()"/>
                
            </p:dialog>
        </h:form>
      <h:form id="Actualise">
            <p:dialog header="Modification" widgetVar="demandeEdit" resizable="false" id="editPer" modal="true">
                <h:panelGrid id="displaye" columns="2" cellpadding="4" style="margin:0 auto;">
                    <h:outputLabel for="id" title="Nom" value="id demande"/>
                    <p:inputText value="#{demandeControlleur.demande.idDemande}"   required="true" requiredMessage="id est obligatoire"/>
                    <h:outputLabel for="id1" title="Nom" value="Libellé" />
                    <p:inputText value="#{demandeControlleur.demande.libelleDemande}"   required="true"/>
                    <h:outputLabel for="prenomC" title="Nom"  value="Description:"/>
                    <p:inputText value="#{demandeControlleur.demande.description}"   required="true"/>
                    
                    <h:outputLabel for="dateE" title="Nom" value="Date Envoie"/>
                    <p:calendar value="#{demandeControlleur.demande.dateEnvoie}"   required="true"/>
                    </h:panelGrid>
                <p:separator/>
                <p:commandButton value="Modifier" update=":f1:AjoutTab" action="#{demandeController.ajoutDemande()}" oncomplete="PF('demandeEdit').hide()"/>
            </p:dialog>
      </h:form>
    </h:body>
        
</html>


et dans la console seulement ces lignes qui s'affiche: