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