I am trying to trigger a method doSomething() through p:selectOneButton. Though every attempt to do so fails.
As p:selectOneButton has no actionListener I thought on using p:ajax and point it to the method doSomething(), but while it compiles without errors it still doesn't trigger the desired method when I click on it.
Here is my code sample:
<h:form id="languageSelectionForm">
<p:selectOneButton value="#{language.selectedLanguage}">
<p:ajax event="change" listener="#{language.doSomething}" />
<f:selectItems value="#{language.languagesMap}" />
</p:selectOneButton>
</h:form>
How can I trigger doSomething() when clicking on p:selectOneButton?