I've got a minimal, complete, and verifiable example working as expected, on which there is an issue I don't finish to understand. The code can be seen below and its behaviour basically consists of selecting an item from a list of a PF ajaxified <p:selectOneListbox>
and displaying the item's value on a JSF <h:outputText>
element.
<h:form id="myform">
<p:selectOneListbox id="myselect" value="#{bean.optionSelected}">
<p:ajax listener="#{bean.onChange}" process="myselect" update="toupdate" onstart="onstart()" oncomplete="oncomplete()" onerror="onerror()" onsuccess="onsuccess()"/>
<f:selectItem itemLabel="Option 1" itemValue="1" />
<f:selectItem itemLabel="Option 2" itemValue="2" />
<f:selectItem itemLabel="Option 3" itemValue="3" />
</p:selectOneListbox>
<h:outputText id="toupdate" value=">#{bean.optionSelected}" />
</form>
Looking at the element, I don't just know what specific event is causing the ajax request to be sent to the server, that is, I don't know if the triggered event was the valuechange event or some other. In other words, I miss a <p:ajax>
element coded in this way:
<p:ajax event="name_of_the_event" .../>
And this doubt makes me to not know the class of the receiving event to be used by the listener method in the backing bean side:
public void onChange(??? event)
Any clarification/explanation would be really appreciated. Thanks.