Reputation: 23
I have a problem using ui:repeat
nested in each other where I'd like to call a listener. I have also tried c:forEach
instead, but got the same problem.
For demonstrating the problem I have simplified the code to the problem. There are two buttons, the first inside the first ui:repeat, calling successful a simple listener. The second button is inside the nested ui:repeat element, should call the same listener as the first button, but the listener is never called.
Can you please tell me whats wrong with this?
<div>
<ui:repeat var="testList" value="#{testBean.testList}">
<h:commandButton value="test1">
// the listener is called if I click this button
<f:ajax event="click" execute="@this" listener="#{testBean.testListener}" />
</h:commandButton>
<ui:repeat var="nestedList" value="#{testList.nestedList}">
<h:commandButton value="test2">
// the listener will not be called if I click this button
<f:ajax event="click" execute="@this" listener="#{testBean.testListener}" />
</h:commandButton>
</ui:repeat>
</ui:repeat>
</div>
Upvotes: 2
Views: 3446
Reputation: 1108632
This is a known Mojarra issue related to broken state management of <ui:repeat>
. Specifically this issue is reported as issue 1817 and fixed since Mojarra 2.1.15.
Upgrade your Mojarra version. It's currently already at 2.1.19.
Upvotes: 3