When I specify process
attribute of p:ajax
tag, the listener is not executed. If I omit the process
attribute, then the listener is called as expected.
Here is the view snippet:
<p:messages id="messages" />
<h:inputText id="inputToProcess" value="#{controller.inputToProcess}" />
<p:selectBooleanCheckbox id="testCheckbox" >
<p:ajax event="change" process="inputToProcess"
update="messages @this inputToUpdate"
listener="#{controller.processChecked}" />
</p:selectBooleanCheckbox>
<h:inputText id="inputToUpdate" value="#{controller.inputToUpdate}" />
And Controller:
@javax.faces.bean.ManagedBean
@javax.faces.bean.ViewScoped
public class Controller implements Serializable {
private String inputToProcess;
private String inputToUpdate;
//getters and setters
public void processChecked(javax.faces.AjaxBehaviorEvent e) {
// doing some stuff here
}
}
I attached a phaseListener
to a view with ANY_PHASE
PhaseId, and here is what I observed.
When I specify process
attribute , the value of the inputToProcess input is successfully set to the controller during the Update Model phase (no exception occurs). Then the Invoke Application
and Render Response
phases are executed, but no listener is called. One thing I noticed is that checkbox is not set in the end. But, there are no conversion or validation errors, because as I said the Update Model
and Invoke Application
phases are executed.
If I omit process
attribute, here is what I see: the listener is normally called during the Invoke Application
phase (since immediate
is false by default), and then `Render Response is executed. Checkbox is successfully set.
Is there any explanation for this sort of behavior?