Primefaces Datatable Lazy - Table does not present records

Asked

Viewed 850 times

3

I’m creating a Lazy datatable, but although the class load is loading the records correctly, the table remains empty.

XHTML:

<p:dataTable value="#{chamadoMB.chamados}" var="c" 
    paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
    rows="10" rowsPerPageTemplate="5,10,15" selectionMode="single" paginator="true" lazy="true" emptyMessage="Não há chamados concluídos">
    <p:column headerText="Prazo" sortBy="#{c.prazo}">
        <h:outputText value="#{c.prazo}">
        <f:convertDateTime pattern="dd/MM"/>
        </h:outputText>
    </p:column>
</p:dataTable>

Chamadolazylist

@Override
public List<Chamado> load(int start, int max, String string, SortOrder so, Map<String, String> map) {
    lista=new ChamadoDao().getChamados(start,max); 
    return lista; //<- Esta List está carregada corretamente
}

1 answer

4


Solved! Missing the total number of records in the Rowcount property.

Chamadolazylist

public ChamadoLazyList(){
    this.setRowCount(new ChamadoDao().getQtChamados());
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.