Primefacesカルーセルコンポーネントを使用して、アイテムのリストを表示します。私がやりたいのは、すべてのカルーセルアイテムにcommandButtonを表示して、Beanのメソッドをトリガーしてエントリを確認または拒否することです。
現在は、カルーセルの最初のエントリに対してのみ機能します。別のエントリをクリックしても、アクションconfirmResourceは呼び出されません。IDと関係があると思いますが、わかりません。
フォームは次のとおりです。
<h:form id="form" prependId="false">
<p:carousel id="resourceCarousel" value="#{resourceRatingBean.resourceProposalList}" var="var" rows="1" itemStyle="width:500px; height: 400px; text-align:center;" circular="true">
<p:column>
<h:panelGrid columns="1" cellpadding="3">
<p:graphicImage value="/cache/images/#{var.imagePath}" width="100"/>
<h:outputText value="#{var.imagePath}" />
<h:outputText value="#{var.name}" />
<h:outputText value="#{var.description}" />
</h:panelGrid>
<p:commandButton value="confirm" action="#{resourceRatingBean.confirmResource}" process="@this">
<f:setPropertyActionListener value="#{var}" target="#{resourceRatingBean.ratedResource}" />
</p:commandButton>
</p:column>
</p:carousel>
</h:form>