Bonjour,
s'il vous plait je veux faire la recherche DEHORS de datatable, mais ça marche pas

voila la fonction recherche:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
 
public List<Fournisseur> rechercheByCriteria(String nom) {
        Session session = HibernateUtil.getSessionFactory().openSession();
        Criteria criteria = session.createCriteria(Fournisseur.class);
        Criterion criterion = Restrictions.eq("nom", nom);
        criteria.add(criterion);
        List<Fournisseur> listFour = criteria.list();
        session.close();
        return listFour;
    }
et dans le bean j'ai le fonction suivant:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
 
private List<Fournisseur> listFour;
 
public List<Fournisseur> getListFour(String n) {
        dao = new GestionFournisseurImpl();
        listFour = dao.rechercheByCriteria(nom);
        return listFour;
    }

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
 
            <h:form>
                <p:panel>
                    <p:inputText value="#{fournisseurBean.fournisseur.nom}" style=" margin-left: 530px;"/>
                    <p:commandButton icon="ui-icon-search" style=" height: 24px;" update=":datatable:Tab"
                                     action="#{fournisseurBean.getListFour(fournisseurBean.fournisseur.nom)}"/>
                </p:panel>
            </h:form>
 
 
            <h:form id="datatable">
                <p:growl id="growl" showDetail="true" sticky="false"  />
 
                <p:dataTable id="Tab" var="four" value="#{fournisseurBean.listFournisseur}" widgetVar="PersonneTable"
                             emptyMessage="Fournisseur non trouvé" paginator="true" rows="10" 
                             paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} 
                             {LastPageLink} {RowsPerPageDropdown}"
                             rowsPerPageTemplate="5,10,15" style=" margin-top: 15px;">
 
                    <p:column id="mat" headerText="Matricule" style=" width: 50px;">
                        <h:outputText value="#{four.matricule}"/>
                    </p:column>
 
                    <p:column id="nom" headerText="Nom" style=" width: 100px;">
                            <h:outputText value="#{four.nom}"/>
                    </p:column>
 
                </p:dataTable>
            </h:form>
Merci d'avance pour votre aide