我已将PrimeFaces从5.1决赛升级到5.2决赛(社区发布).我有一个<p:dataTable>
懒惰加载如下(一个最小的例子来重现问题仅用于纯测试目的).
<p:dataTable var="row"
value="#{testManagedBean}"
lazy="true"
editable="true"
rowKey="#{row.fruitId}"
selection="#{testManagedBean.selectedValues}"
rows="50">
<p:column selectionMode="multiple"/>
<p:ajax event="rowEdit" listener="#{testManagedBean.onRowEdit}"/>
<p:column headerText="Id">
<h:outputText value="#{row.fruitId}"/>
</p:column>
<p:column headerText="Fruit Name">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{row.fruitName}"/>
</f:facet>
<f:facet name="input">
<p:inputText value="#{row.fruitName}"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Price">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{row.price}"/>
</f:facet>
<f:facet name="input">
<p:inputText value="#{row.price}"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Edit">
<p:rowEditor/>
</p:column>
</p:dataTable>
Run Code Online (Sandbox Code Playgroud)
相应的托管bean:
@Named
@ViewScoped
public class TestManagedBean extends LazyDataModel<Fruit> implements Serializable {
private List<Fruit> selectedValues; // Getter & setter.
private static final long serialVersionUID …
Run Code Online (Sandbox Code Playgroud)