Edited with additional info for clarity
We are migrating application from JBoss 5 to Tomee 7.0.1+. On Tomee we are using MyFaces 2.2.10 and RichFaces 4.2.0 (on Jboss we used Mojarra JSF instead of MyFaces).
We have a problem with f:ajax listener not triggering on value change in the radio button list. Here is our code:
<h:selectOneRadio value="#{managedBean.paramsType}"
layout="pageDirection">
<f:selectItem itemValue="Item1" itemLabel="Item1" />
<f:selectItem itemValue="Item2" itemLabel="Item2" />
<f:ajax render="@form" execute="@form" listener="#{managedBean.checkSelection}" />
</h:selectOneRadio>
<h:selectManyCheckbox value="#{managedBean.objectList}" layout="pageDirection">
<f:selectItem itemValue="checkOption1" itemLabel="Option1" itemDisabled="#{managedBean.paramsType == 'Item3'}"/>
<f:selectItem itemValue="checkOption2" itemLabel="Option2" itemDisabled="#{managedBean.paramsType == 'Item1'}"/>
<f:selectItem itemValue="checkOption3" itemLabel="Option3" itemDisabled="#{managedBean.paramsType == 'Item2'}"/>
</h:selectManyCheckbox>
In managed bean the checkSelection method has the following signature:
public void checkSelection()
{
//update objectList (select or deselect items) based on radio button selection
}
Check selection is never called when running the app on TomEE but the same worked on JBoss (identical code).
On TomEE, we tried adding AjaxBehaviorEvent as input parameter of checkSelection method, but the method is never called with or without this parameter. It looks like the listener attribute of f:ajax is not processing the event for some reason.
No errors are reported in the browser console or in application or server logs - the method is simply never called. Also, h:messages doesn't display any error.
Also, we tried with a4j:ajax and valueChangeListener. a4j:ajax behaves the same as f:ajax - method defined in managed bean is not called; valueChangeListener doesn't work for us because it is triggered by a different event than the f:ajax listener and we need a change of selection in radio buttons to affect the selection of a h:selectManyCheckbox component on the same form.