I'm a beginner with JSF and I've a small problem, if I use a h:commandButton inside a c:forEach then it doesn't trigger the method but if I use it outside the c:forEach then it works. In my code below the "First test" works but not the "Second Test".
Do you guys have any idea why it doesn't work?
Thanks in advance
<p:panel>
<h:panelGrid id="searchResult">
<!-- First Test -->
<h:commandButton value="ID" action="#{database.addShow(257655)}">
<f:ajax execute="@this"/>
</h:commandButton>
<!-- Second Test -->
<c:forEach items="#{theTVDB.series}" var="item">
<h:panelGroup styleClass="searchResultElement" layout="block">
<h:outputText value="#{item.name}"/><br/>
<h:graphicImage value="#{item.banner}" />
<h:commandButton value="#{item.id}" action="#{database.addShow(257655)}">
<f:ajax execute="@this"/>
</h:commandButton>
</h:panelGroup>
</c:forEach>
</h:panelGrid>
</p:panel>
Update : The answer in this Topic doesn't work