Bonjour,
j'ai essayé de gerer des evenements simples de type ActionListener mais malheureusement j'ai des problèmes. lorsque je clique sur mon bouton j'obtient une exception de type javax.el.MethodNotFoundException
voici ma page JSF:
et Mon managed Bean<f:view>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>JSP Page</title>
</head>
<body>
<h1><h:outputText value="JavaServer Faces"/></h1>
<h:form>
a: <h:inputText value="#{Calcul.a}"/><br>
b: <h:inputText value="#{Calcul.b}"/><br>
<h:commandButton value="Calculer" actionListener="#{Calcul.TraiterAction}"/><br>
resultat: <h:inputText value="#{Calcul.r}"/><br>
</h:form>
</body>
</html>
</f:view>
package app;
import java.awt.event.ActionEvent;
import javax.faces.event.ValueChangeEvent;
import javax.faces.model.SelectItem;
public class Calcul {
private int a;
private int b;
private int r;
public void TraiterAction(ActionEvent ev){
System.out.println("hello");
}
public int getA() {
System.out.println("hghgh");
return a;
}
public void setA(int a) {
this.a = a;
}
public int getB() {
return b;
}
public void setB(int b) {
this.b = b;
}
public int getR() {
return r;
}
public void setR(int r) {
this.r = r;
}
/** Creates a new instance of Calcul */
public Calcul() {
}
}
Partager