here is the code snipprt
<p:calendar
id="from"
value="#{documentInsertController.from}"
yearRange="1900:2015"
pattern="dd/MM/yyyy"
mindate="#{documentInsertController.today}"
valueChangeListener="#{documentInsertController.calenderChangeListener}"
>
<p:ajax event="change" partialSubmit="from" render="to"/>
</p:calendar>
This is the actionlister method in bean class
public void calenderChangeListener(ValueChangeEvent e) {
System.out.println("Calender Change Listener Invoked: " + e.getNewValue());
}
I want to know what is missing and why it is not invoking the action method?
You can try <p:ajax event="dateSelect"
Like this (I removed the partialSubmit="from"
and instead of render
changed into update
because its p:ajax
and not f:ajax
<p:ajax event="dateSelect"
listener="#{documentInsertController.calenderChangeListener}"
update="to"/>
Also change your method signature into:
public void calenderChangeListener(SelectEvent event) {
Date date = event.getDate();
System.out.println("File Date: " + date);
System.out.println("Hello... I am in DateChange");
}