Primefaces:数据表选择不适用于 ajax

Primefaces: DataTable selection is not working with ajax

对不起我的英语。我使用 DataTable 选择,我想使用 DataTable 选择和 ajax:

<h:form id="form">
    <p:dataTable id="testTableId" var="testTable" value="#{testMB.entityList}"
                 selection="#{testMB.selectedList}" rowKey="#{testTable.id}"
                 tableStyleClass="table table-hover table-bordered">

        <p:column selectionMode="multiple" style="width:16px;text-align:center"/>
        <p:column headerText="testName">
            #{testTable.name}
        </p:column>
        <f:facet name="footer">
            <p:commandButton process="testTableId" action="#{testMB.deleteSelected}" value="It is working"/>

            <p:commandButton process="testTableId" action="#{testMB.deleteSelected}" value="It is not working">
                <p:ajax update="@form" />
            </p:commandButton>              
        </f:facet>
    </p:dataTable>
</h:form>

如果我点击按钮 It is working 那么它就可以工作了。但是,如果我单击 ajax 按钮 It is not working 则它不起作用。

如何将它与 ajax 一起使用?

请返回 PrimeFaces 展示并了解 PrimeFaces 数据表和 ajax 选择。在展示中找不到像您这样的示例与 ajax 选项结合使用。