1

i try to call a simple actionlistener which updates a value from a xhtml page using JSF 2 and primefaces. The action listener is never called and there is no error in server log(Tomcat) or anywhere. The thing that really drives me insane is that i have implemented this in the past successfully, i still have the code, and everything is the same!!!

Here is the .xhtml code:

<?xml version="1.0"?>
<f:view xmlns="http://www.w3.org/1999/xhtml"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head />
<h:body>



    <h:form id="form1">
       <h:inputText value="#{LessonDates.teacher_name}" />
        <p:commandButton value="Submit" actionListener="# {LessonDates.doIt}" />
    </h:form>
    <h:outputText value="#{LessonDates.teacher_name}" />
</h:body>

and the javaBean :

@ManagedBean(name = "LessonDates" , eager = true)
@RequestScoped
public class LessonDatesBean implements Serializable {

public Date date;
public String teacher_AFM;
public String teacher_name = "Kritikos";
public boolean booked;

public List<LessonDates> lessonDatesList;
public List<Teacher> teacherList;

public LessonDatesBean(){

}


public void doIt(ActionEvent event) throws  SystemException {


    String buttonId = event.getComponent().getClientId();

    teacher_name = "Nikos";



}


public List<LessonDates> getLessonDatesList() {
    return lessonDatesList;
}

public void setLessonDatesList(List<LessonDates> lessonDatesList) {
    this.lessonDatesList = lessonDatesList;
}

public Date getDate() {
    return date;
}

public void setDate(Date date) {
    this.date = date;
}

public String getTeacher_AFM() {
    return teacher_AFM;
}

public void setTeacher_AFM(String teacher_AFM) {
    this.teacher_AFM = teacher_AFM;
}

public String getTeacher_name() {
    return teacher_name;
}

public void setTeacher_name(String teacher_name) {
    this.teacher_name = teacher_name;
}

public boolean isBooked() {
    return booked;
}

public void setBooked(boolean booked) {
    this.booked = booked;
}

Any help will be much appreciated.

0 Answers0