1

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.

JPS
  • 2,730
  • 5
  • 32
  • 54

1 Answers1

1

this is a known issue in PF 4.0. It has been fixed in Elite versions, but the problem still occurred with live scrolling. PrimeFaces 5.0 just arrived yesterday as a community (free to use) release, and AFAIK that release contains the fix for this behavior.

Tushee
  • 251
  • 2
  • 8
  • I have tested it after migrating my application to 5.0. But same problem occurs :( – JPS May 17 '14 at 12:34
  • Does this problem still exists ? I am new to the primefaces. I just came across some similar situation like this. – Arka Mallick Sep 27 '19 at 13:05