Bonjour,

J'ai un problème lors de la suppression d'un objet :

Nom : delete.JPG
Affichages : 418
Taille : 57,8 Ko

Mon Managed Bean:
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
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
public class RatManagedBean implements Serializable {
 
    /** The Constant serialVersionUID. */
    private static final long serialVersionUID = 1L;
 
    @Autowired
    RatService ratService;
 
    private List<RatEntity> ratList;
    private String ratType;
    private Integer ratCode;
    private RatEntity selectedRat;
 
    @PostConstruct
    public void init() throws DAOException {
        System.out
                .println("********************* in*****************************it*************");
 
        ratList = new ArrayList<RatEntity>();
        ratList.addAll(ratService.findAllRats());
 
    }
 
    public String addRat() throws DAOException {
        RequestContext context = RequestContext.getCurrentInstance();
        RatEntity rat = new RatEntity(ratCode, ratType);
        try {
            ratService.insertRat(rat);
            reset();
            ratList.add(rat);
            return "index.xhtml ?faces-redirect=true";
        } catch (DAOException e) {
            FacesContext context1 = FacesContext.getCurrentInstance();
            context1.addMessage(null, new FacesMessage("Erreur!",
                    "L'ajout du RAT a échoué"));
            context.addCallbackParam("add", false);
            e.printStackTrace();
        }
        return "error.xhtml ?faces-redirect=true";
    }
 
 
    public void deleteRat(RatEntity selectedRat) throws DAOException{
 
        try {
            ratService.deleteRat(selectedRat);
            ratList.remove(selectedRat);
        } catch (DAOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
 
    }
 
    public List<RatEntity> getRatList() {
        return ratList;
    }
 
    public void setRatList(List<RatEntity> ratList) {
        this.ratList = ratList;
    }
 
    public String getRatType() {
        return ratType;
    }
 
    public void setRatType(String ratType) {
        this.ratType = ratType;
    }
 
    public Integer getRatCode() {
        return ratCode;
    }
 
    public void setRatCode(Integer ratCode) {
        this.ratCode = ratCode;
    }
 
    public RatEntity getSelectedRat() {
        return selectedRat;
    }
 
    public void setSelectedRat(RatEntity selectedRat) {
        this.selectedRat = selectedRat;
    }
 
    /**
     * reset Add form method
     */
    public void reset() {
        this.setRatType("");
    }
}
ma page xhtml:
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<h:form id="form">
            <p:dataTable id="ratTable" var="rat" value="#{ratMB.ratList}" styleClass="userDataTableStyle"
                        paginator="true" rows="10" selection="#{ratMB.selectedRat}"  rowKey="#{rat.code}">
                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                         rowsPerPageTemplate="5,10">
            <f:facet name="header">
                    Liste des Radio Acess Type
                </f:facet>
                 <p:column selectionMode="single" style="width:16px;text-align:center"/>
                    <p:column headerText="Code du Rat" sortBy="#{rat.code}">
            <h:outputText value="#{rat.code}"></h:outputText>
            </p:column>
            <p:column headerText="Type du RAT" sortBy="#{rat.type}">
            <h:outputText value="#{rat.type}"></h:outputText>
            </p:column>
 
            <f:facet name="footer">
                <p:commandButton value="Ajouter" oncomplete="newRatDialog.show()" icon="ui-icon-star" title="Ajouter un nouvel Radio Access Type" />
                <p:commandButton value="Supprimer" onclick="confirmation.show()" update="ratTable" icon="ui-icon-trash"/>
            </f:facet>
        </p:dataTable> 
</h:form>
        <p:dialog header="Créer un nouvel Radio Access Type" widgetVar="newRatDialog" resizable="false" id="newRatDialog">
            <h:form id="newdirecForm">
                <p:panelGrid id="displayNewRat" columns="4" style="margin:0 auto;">
                    <h:outputText value="Code :"></h:outputText>
                    <p:inputText value="#{ratMB.ratCode}" />
                    <h:outputText value="Type :"></h:outputText>
                    <p:inputText value="#{ratMB.ratType}" />
 
 
                    <f:facet name="footer">
                        <p:commandButton value="Valider" update=":form:ratTable"
                            oncomplete=" handleSubmitRequest(xhr, status, args, 'newActiviteDlg','newdirecForm');"
                            action="#{ratMB.addRat}" />
                        <p:commandButton type="Vider" value="Annuler" />
                    </f:facet>
                </p:panelGrid>
            </h:form>
        </p:dialog>
 
        <p:dialog id="confirmDialog"  header="Confirmation de suppression"  widgetVar="confirmation">  
                  <table width="100%" border="0"  cellspacing="0" >
 
                      <tr >
                       <td style="border: 0; "> <h:outputText value="Voulez vous vraiment supprimer le RAT"></h:outputText></td>
 
                     </tr>
                     <tr></tr> <tr></tr>
 
                          <tr>
                            <td colspan="3" align="right" style="border: 0;  ">
                                <hr style="color:orange"> </hr>
                            </td>
                          </tr>
                          <tr></tr>   <tr></tr>
                        <tr>
                            <td colspan="2"  style="border: 0; ">
                              <p:commandButton  value="OUI" update=":form:ratTable" oncomplete="confirmation.hide()"  
                            actionListener="#{ratMB.deleteRat}" />  
                          <p:commandButton value="NON" onclick="confirmation.hide()" type="button" />     
                            </td>
 
                        </tr>
                  </table>
 
          </p:dialog>
j'ai cette erreur :
SEVERE: Received 'javax.el.MethodNotFoundException' when invoking action listener '#{ratMB.deleteRat}' for component 'j_idt23'
javax.faces.event.MethodExpressionActionListener processAction
SEVERE: javax.el.MethodNotFoundException: Method not found: com.xxxx.beans.RatManagedBean@1481484b.deleteRat()
Quelqu'un saurait-il m'indiquer comment résoudre ce problème ?

Merci d'avance