2
我使用Primefaces輪播組件顯示項目列表。我想要做的是在每個傳送帶項目上顯示一個commandButton,它觸發bean上的一個方法來確認或拒絕該條目。Primefaces commandButton僅適用於輪播組件的第一個條目
現在它僅適用於輪播的第一個條目。點擊另一個條目不會調用操作confirmResource。我想這與身份證有關,但我無法弄清楚。
這裏的形式:
<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>
設置過程= 「@形式」,它就像一個魅力!以爲我曾嘗試過;-) ..感謝您的解決方案! – tobiasdenzler 2012-07-31 11:42:34