The valueChangeListener
is only necessary, if you are interested in both the old and the new value.
If you are only interested in the new value, the use of <p:ajax>
or <f:ajax>
is the better choice.
There are several possible reasons, why the ajax call won't work. First you should change the method signature of the handler method: drop the parameter. Then you can access your managed bean variable directly:
public void handleChange(){
System.out.println("here "+ getEmp().getEmployeeName());
}
At the time, the listener is called, the new value is already set. (Note that I implicitly assume that the el expression mymb.emp.employeeName
is correctly backed by the corresponding getter/setter methods.)