Primefaces DataTable Lazy - Table does not display records

3

I'm creating a lazy datatable, but although the load of the class 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>

CalledLazyList

@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
}
    
asked by anonymous 13.12.2013 / 14:10

1 answer

4

Solved! It was missing the total amount of records in the RowCount property.

CalledLazyList

public ChamadoLazyList(){
    this.setRowCount(new ChamadoDao().getQtChamados());
}
    
13.12.2013 / 16:38