我有这个代码:
<p:contextMenu for="customersTable">
<p:menuitem value="Delete" update="customersTable" icon="ui-icon-close" actionListener="#{customerbean.onDeleteCustomer}"/>
</p:contextMenu>
<p:dataTable id="customersTable" var="customer" widgetVar="customerTable" value="#{customerbean.customerList}" paginator="true" rows="20" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="10,20,50,100" emptyMessage="#{text['table.customer.filter.notfound']}" filteredValue="#{customerbean.filteredCustomers}" editable="true" draggableColumns="true" rowKey="#{customer.id}" selection="#{customerbean.selectedCustomer}" selectionMode="single">
我的问题是,当我单击 contextMenu 中的“删除”时,一切正常,因为记录/行正在通过 bean 方法调用从后端删除,但是表没有更新以反映新数据.