In Primefaces (JSF), in a web form I have 2 fields one & two. And on field two I have a change event which triggers myListener and inside that I am trying to read the field values of both one and two. But I get only the value of field two which triggers the event but not field one.
Is this the expected behaviour in JSF ? I need to do a cross field calculation with more than one fields.
HTML
<p:row>
<p:column>
<p:inputNumber id="one" value="#{bean.model.one}" />
</p:column>
<p:column>
<p:inputNumber id="two" value="#{bean.model.two}" >
<p:ajax event="change" listener="#{bean.myListener}" />
</p:inputNumber>
</p:column>
</p:row>
Java
public void myListener() {
System.out.println(model.one); // prints null. Why ??
System.out.println(model.two); // prints value
}