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>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…