I have a DataTable that presnt a list of product :
<p:dataTable var="product" value="#{myModel.products}"
scrollable="true" id="productsTableId" liveResize="true"
resizableColumns="true">
<f:facet name="header">
List of products
</f:facet>
<p:column headerText="Id" sortBy="id">
<h:outputText value="#{product.id}" >
</h:outputText>
</p:column>
<p:column headerText="Name" sortBy="name">
<h:outputText value="#{product.name}" title="#{product.name}" />
</p:column>
<p:column headerText="Remove product">
<p:commandButton icon="ui-icon-close" title="delete product"
value="Disconnect"
action="#{controller.delete(product)}"
update="productTableId">
<p:confirm header="Confirmation"
message="Are you sure you want to delete this product"
icon="ui-icon-alert" />
</p:commandButton>
</p:column>
</p:dataTable>
but the problem comes when i try to sort the datatable, the rows change their diplay order but the buttons functionalities keep the initial order ,i.e. if i have for example two products :
Id Name Remove product
1 B Delete B
2 A Delete A
after sorting by name
Id Name Remove product
2 A Delete A
1 B Delete B
If i click 'Delete A' then the product B is removed , is this a bug in PrimeFaces or i'm missing something .
i'm using PrimeFaces 4.0 ,JSF Mojarra 2.1.20 on jetty-9.1.2.