Hi I am using primefaces 4.0 and jsf 2x. In my application i have a editable datatable with filtering. whenever i filter a row and click to edit i am not getting the row value that i select.
PFB my Bean class:
class MyBean{
private List<MyEntity> details;
private List<MyEntity> filteredDetails;
private MyEntity entity;
private DataTable dataTable;
//Setters and Getters
}
Part of my xhtml page:
<p:dataTable value="#{myBean.details}"
var="dashboard"
binding="#{myBean.dataTable}"
id="dashboardTable" paginator="true" rows="10"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"
rowsPerPageTemplate="10"
filteredValue="#{myBean.filteredDetails}"
widgetVar="viewdashboardtable" paginatorPosition="bottom">
<f:facet name="header">
<h:outputText value="Dashboard Details"></h:outputText>
</f:facet>
<p:column id="column1" filterBy="customerNumber"
filterMatchMode="contains">
<f:facet name="header">
<h:outputText value="customerNumber"></h:outputText>
</f:facet>
<h:commandLink value="#{dashboard.customerNumber}"
action="editdetails">
<f:setPropertyActionListener value="#{dashboard}"
target="#{myBean.Entity}" />
</h:commandLink>
</p:column>
.......
.......
Here per page only two rows will be displayed. The page shows the customer details for customer number 1,2,3 and 4 in a sorted order.
-------------------------------------------------------
customerNumber Name Age
-------------------------------------------------------
1 Dheepan 23
2 Sasi 23
3 Pushparaj 24
4 Prabha 24
When i filter the table with customer number 3, i am getting only one row shown as below.
-------------------------------------------------------
customerNumber Name Age
-------------------------------------------------------
3 Pushparaj 24
If i click on customer number to edit now, i am getting the customer details of 1 instead of 3. The problem is after filtering the details of row index 1 is having the customer details for the customer number 1. Can anybody help me to resolve this problem?
Update: The same problem happens for rowExpansion + Filter also.