bonjour , je veux afficher des donnes dans le tableau de richfaces datatable
le probleme que mon tableau s'affiche mais sans les donnnes (vide) !
voila ma page .jsp :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
 
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
 <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Produits</title>
</head>
<body>
<f:view>
<h:form>
 <p style="text-align: center;">La liste des Produits :</p>
  <center> 
  <rich:dataTable value ="#{produit.listProduit}" var="p " rows="5" columnClasses="50,100,100,100">
  <rich:column sortBy="#{p.nom}" filterBy="#{p.nom}"
   filterEvent="onkeyup" style="text-align: center; " styleClass="spec"> 
   <f:facet name="header">
    <f:verbatim>Nom </f:verbatim> 
    </f:facet> 
    <h:outputText value="#{p.Nom}" /> 
    </rich:column>
   <rich:column style="text-align: center;">
    <f:facet name="header"> 
    <h:outputText value="Supprimer" styleClass="nobg">
    </h:outputText> 
    </f:facet>
     <h:commandButton image="Delete.png" actionListener="#{produit.supprimerPersonne}" > 
     <f:param id="supid" name="id" value="#{p.idProduit}" />
      </h:commandButton>
       </rich:column>
            <f:facet name="footer"> 
              <rich:datascroller id="ds" renderIfSinglePage="false">
                 </rich:datascroller> 
                    </f:facet> 
                      </rich:dataTable> 
                       </center> 
                        </h:form>
</f:view>
</body>
</html>
et voila maliste listProduit :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 
public List getListProduit() {
	try { Session session = HibernateUtil.getSessionFactory().getCurrentSession();
	session.beginTransaction();
	Query q = session.createQuery("from Produit ");
	listP = q.list();
	System.out.println(listP.size());
	for (Produit p : listP)
	{
		System.out.println(p.getNom());
	}
 
	session.getTransaction().commit();
	HibernateUtil.getSessionFactory().close();
	}
 
	catch(Exception e) { } 
	return listP;
}
 
Merci de me aidez :)