after filtering Empty rows blank rows displayed while paging in the datatable using Primefaces
Asked Answered
M

2

5

I have problem with datatable using Primefaces 2.2.1 and JSF 2.0.

I have used filtering and paging in the datatable. When I try to filter the selected data is displayed and when i remove the filter the entire data is displayed. But after this when i try to use paging then suddendly all the rows becomes blank(empty) See screenshot below

enter image description here

enter image description here

enter image description here

Any suggestions. Please help.

.xhtml file

<p:dataTable var="user" value="#{userManagedBean.searchUsersResults}"
        selection="#{userManagedBean.selectedUser}" selectionMode="single"
        dynamic="true"
        onRowSelectUpdate="userUpdateForm"
        onRowUnselectUpdate="userUpdateForm"
        rowSelectListener="#{userManagedBean.onUserSelect}"
        rowUnselectListener="#{userManagedBean.onUserUnselect}"
        paginator="true" rows="10" style="width: 70% ">
        <p:column sortBy="#{user.userId}" filterBy="#{user.userId}" >
            <f:facet name="header">
            <h:outputText value="Id" />
            </f:facet>
            <h:outputText value="#{user.userId}" />
            </p:column>
            <p:column sortBy="#{user.username}" filterBy="#{user.username}">
            <f:facet name="header">
            <h:outputText value="Name" />
            </f:facet>
            <h:outputText value="#{user.username}" />
            </p:column>
            <p:column sortBy="#{user.emailId}" filterBy="#{user.emailId}">
            <f:facet name="header">
            <h:outputText value="Email" />
            </f:facet>
            <h:outputText value="#{user.emailId}" />
            </p:column>
            <p:column sortBy="#{user.dob}" filterBy="#{user.dob}">
            <f:facet name="header">
            <h:outputText value="DOB" />
            </f:facet>
            <h:outputText value="#{user.dob}" >
                <f:convertDateTime pattern="MM/dd/yyyy" />
            </h:outputText>
        </p:column>
    </p:dataTable>
    <p:panel id="userDetailsPanelId" header="Users Details" style="width:60%;">
    <h:panelGrid columns="2" cellpadding="2" id="userUpdateForm" border="0" >
            <h:outputLabel for="#{userManagedBean.selectedUser.userId}" value="UserId"/>
            <h:inputText value="#{userManagedBean.selectedUser.userId}" style="width: 100%;" readonly="true"></h:inputText>

            <h:outputLabel for="#{userManagedBean.selectedUser.username}" value="Username"/>
            <h:inputText value="#{userManagedBean.selectedUser.username}" readonly="true"></h:inputText>

            <h:outputLabel for="#{userManagedBean.selectedUser.emailId}" value="EmailId"/>
            <h:inputText value="#{userManagedBean.selectedUser.emailId}" readonly="true"></h:inputText>

            <h:outputLabel for="#{userManagedBean.selectedUser.gender}" value="Gender"/>
            <h:inputText value="#{userManagedBean.selectedUser.gender}" readonly="true"></h:inputText>

            <h:outputLabel for="#{userManagedBean.selectedUser.dob}" value="DOB"/>
            <h:inputText value="#{userManagedBean.selectedUser.dob}" readonly="true">
                <f:convertDateTime pattern="MM/dd/yyyy" />
            </h:inputText>

        </h:panelGrid>
        </p:panel>
    </h:form>
    </center>

Menefee answered 18/2, 2011 at 14:31 Comment(0)
V
13

I encountered the same problem and eventually discovered it was caused by my value object (in this case your user object) not implementing Serializable.

Volumeter answered 3/5, 2011 at 14:27 Comment(0)
D
0

I'm pretty sure that this known issue has been resolved in both the 2.2.RC and the 2.2 final. I suggest updating your jar file.

Dorcas answered 19/2, 2011 at 16:43 Comment(4)
Thanks for your reply. but i m already using primefaces-2.2.1.jar which is available on the primefaces website. Have you got any other web urls links to get to "the 2.2.RC and the 2.2 final". Please suggest.Menefee
Nope, your correct, that's the most recent release according their site. You may want to try the PrimeFaces support forum, or report this as a bug to PrimeFaces.Dorcas
Yes. I have reported it in the PrimeFaces but still no luck. primefaces.prime.com.tr/forum/viewtopic.php?t=7931Menefee
Hi Sean, can you look into this question if possible #5033724Menefee

© 2022 - 2024 — McMap. All rights reserved.