problème avec le composant <rich:datatable> et une requete hql
Bonjour, je suis encore débutante en jsf or là je bloque depuis un bout de temps parce que ma page s'affiche et ma table est vide..:cry: :cry: bon voila
le fichier ajoutLot.jsp
Code:
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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
| <rich:tabPanel>
<rich:tab label="Rechercher un appareil par numéro d'inventaire">
<center>
<table>
<tr>
<td><h:outputText value=" Numéro d'inventaire " /></td>
<td><h:inputText value="#{inventmBean.numeroDInventaire}" /></td>
</tr>
<tr>
<td></td>
<td><h:commandButton value ="chercher" action="#{inventmBean.getListRechercheNumInv}"/></td>
</tr>
<tr>
<td></td>
<td>
</td>
</tr>
</table>
</center>
</rich:tab>
</rich:tabPanel>
</center>
<center>
<rich:dataTable value="#{inventmBean.listRechercheNumInv}" var="b" rows="13" binding="#{inventmBean.matable}" rowClasses= "row1,row2" headerClass="heading">
<f:facet name="footer">
<rich:datascroller selectedStyle="font-weight:bold">
</rich:datascroller>
</f:facet>
<rich:column >
<f:facet name="header" >
<h:outputText value="Numéro d'inventaire" />
</f:facet>
<h:outputText value="#{b.numeroDInventaire}"/>
</rich:column>
<rich:column >
<f:facet name="header" >
<h:outputText value="Désignation" /></f:facet>
<h:outputText value="#{b.designation}"/>
</rich:column>
<rich:column >
<f:facet name="header" >
<h:outputText value="Constructeur" /></f:facet>
<h:outputText value="#{b.constructeur}"/>
</rich:column>
<rich:column >
<f:facet name="header">
<h:outputText value="Modèle"/>
</f:facet>
<h:outputText value="#{b.modele}"/>
</rich:column>
<rich:column >
<f:facet name="header">
<h:outputText value="Numéro de série"/>
</f:facet>
<h:outputText value="#{b.numeroDeSerie}"/>
</rich:column>
<rich:column >
<f:facet name="header">
<h:outputText value="Appareil associé" />
</f:facet>
<h:outputText value="#{b.appareilAssocie}"/>
</rich:column>
<rich:column >
<f:facet name="header">
<h:outputText value="Date de réception"/>
</f:facet>
<h:outputText value="#{b.dateDeReception}"/>
</rich:column>
<rich:column >
<f:facet name="header">
<h:outputText value="Etat à la réception"/>
</f:facet>
<h:outputText value="#{b.etatALaReception}"/>
</rich:column>
<rich:column >
<f:facet name="header">
<h:outputText value="Critère de conformité"/>
</f:facet>
<h:outputText value="#{b.critereDeConformite}"/>
</rich:column>
<rich:column >
<f:facet name="header">
<h:outputText value="Périodicité"/>
</f:facet>
<h:outputText value="#{b.periodicite}"/>
</rich:column>
<rich:column >
<f:facet name="header">
<h:outputText value="Documentation"/>
</f:facet>
<h:outputText value="#{b.documentation}"/>
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Modifier" />
</f:facet>
<h:commandLink value="Modifier" action="#{authmBean.versModifier}" >
</h:commandLink>
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Suppression" />
</f:facet>
<h:commandLink value="Supprimer" action="#{authmBean.supprimer}" onclick="return confirm('Voulez-vous supprimer cet element?')"> <img src="images/delete.gif" />
</h:commandLink>
</rich:column>
</rich:dataTable>
</center>
</h:panelGrid>
</h:panelGrid> |
et la fonction getListRechercheNumInv qui strouve dans l'inventmBean
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
public List getListRechercheNumInv()
{
List users = new ArrayList();
try {
org.hibernate.Session session = NewHibernateUtil.currentSession();
org.hibernate.Query q = session.createQuery("from inventaire");
users = q.list();
} catch (Exception e) {
e.printStackTrace();
}
return users;
} |