Column sortby with pagination and not lazyload

UI Components for JSF
Post Reply
Posts: 1
Joined: 07 May 2021, 19:28

07 May 2021, 19:39

Hello, I'm new in this forum, using Primefaces 10.0.0, java 11, springboot 5.

i have a data table like this:

Code: Select all

 <p:dataTable id="testDT" var="test" value="#{dtViewDashboard.testList}"
                         selection="#{dtViewDashboard.facturasCorreos}" rowKey="#{}" selectionPageOnly="false"
                         widgetVar="testTable" paginator="true" rows="20" rendered="#{}"
                         emptyMessage="#{msgGlobal['message.facturasVacias']}" filteredValue="#{dtViewDashboard.testListF}"
                         paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                         currentPageReportTemplate="{startRecord}-{endRecord} de {totalRecords} facturas"
                         reflow="true"  stripedRows="true" draggableColumns="true" tableStyle="table-layout:auto" editMode="cell" editable="true"
                         stickyHeader="false" stickyTopAt=".layout-topbar" > 
                         <f:facet name="header">
                    <div class="p-d-flex p-ai-center p-jc-between">
                        <p:inputText id="globalFilter" onkeyup="PF('testTable').filter()" style="width:10rem;margin-left: 16px" placeholder="#{msgGlobal['placeholder.test']}" />
                        <p:selectOneMenu  value="#{dtViewDashboard.estadoSelect}" style="margin-left: 16px; vertical-align: middle">
                            <f:selectItems value="#{dtViewDashboard.estados}" />
                            <p:ajax event="change" listener="#{dtViewDashboard.consultaTest}" update="form1 form form2" />
                        <p:commandButton id="toggler" type="button" value="#{msgGlobal['boton.seleccionarColumnas']}" style="float:right" icon="pi pi-ellipsis-v"/>
                        <p:columnToggler datasource="empresasDT" trigger="toggler"/>
                <p:ajax event="rowSelectCheckbox" update="form" />
                <p:ajax event="rowUnselectCheckbox" update="form" />
                <p:ajax event="rowSelect" update="form" />
                <p:ajax event="rowUnselect" update="form" />

                <p:column headerText="#{msgGlobal['header.test']}" sortBy="#{}" filterBy="#{}" style="text-align: center">
                    <h:outputText value="#{}" />
I've tried with lazy loading, without lazy loading and the resutl is the same, my data table is not being sorted.

here is my bean init method:

Code: Select all

    public void init(){
service.getTest returns a list of 1519 elements being paginated on the data table.

Posts: 2647
Joined: 22 Apr 2013, 15:48

09 May 2021, 15:10

Are you using client state saving by any chance? And could your issue be this:

Code: Select all
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile:
PrimeFaces Elite 10.0.2 / PF Extensions 10.0.2

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 44 guests