【发布时间】:2021-07-04 21:50:51
【问题描述】:
这是我的问题。我在<ui: repeat> 中有两个<p: commandLink>。
当我单击它们时,我需要通过模拟复选框来更新这些按钮。
在<ui:repeat> 周围更新<panelGroup> 有效。但是,对于包含许多项目的列表,单击更新按钮后,它会使屏幕返回列表顶部,从而无法选择许多项目。有什么方法可以在<p:commandLink> 中提供更新特定行吗?
<tbody>
<ui:repeat value="#{myBean.itens}" var="item" varStatus="index">
<tr class="myCustomClass" id="item#{item.id}">
<th>
<p:commandLink
rendered="#{myConditionRendered}"
actionListener="#{myBean.deselect(item)}"
update=":panelGroupArroundId"
process="@this">
<i style="font-size: 15px;" class="fa fa-check-square-o" />
</p:commandLink>
<p:commandLink
rendered="#{!myConditionRendered}"
actionListener="#{myBean.select(item)}"
update=":panelGroupArroundId"
process="@this">
<i style="font-size: 15px;" class="fa fa-square-o" />
</p:commandLink>
</th>
<td>
<h:outputText value="#{item.field1}"/>
</td>
...
</tr>
</ui:repeat>
</tbody>
JSF 版本:2.1
Primefaces 版本:3.5
【问题讨论】:
标签: jsf primefaces jsf-2