Currently I have a problem similar to
jsf listener not called inside nested ui:repeat
After I got the solution of this problem I upgraded Mojarra to Version 2.1.16.
Everthing works fine, up to the moment I was implementing the below-mentioned view.
The Code is simplified to the basics.
xhtml:
<form>
<div>
// listener is called
<h:commandLink value="test1">
<f:ajax event="click" listener="#{testBean.testListener}" />
</h:commandLink>
<ui:repeat var="testList" value="#{testBean.testList}">
// listener is not called !
<h:commandLink value="test2">
<f:ajax event="click" listener="#{testBean.testListener}" />
</h:commandLink>
</ui:repeat>
</div>
</form>
bean:
@ManagedBean(name="testBean")
@ViewScoped
public class TestBean {
private Collection<TestObj> testList;
public Collection<TestObj> getTestList() {
return this.testList;
}
// the listener
public void testListener() {
...
}
}
Even if I change ui:repeat
to c:forEach
, the problem is the same!
Just if I use @SessionScope
instead of @ViewScope
the 2nd commandLink (inside the iteration) calls the listener. But I'd like to avoid @SessionScope
at this bean.
Do you have any hints for me about the reason of this problem and how to handle it?