Primefaces "sortBy=" funktioniert nicht

Ich entwickle eine Anwendung mit Primefaces + JSF. Meine Daten Tabelle funktioniert, hat aber ein problem beim Sortieren sortBy= habe ich versucht sortBy="#{pc.rota}" aber es funktioniert nicht:

Daten der Tabelle zeigen alle Zeilen, die das problem denke ich ist sortBy= oder meine backing-bean.

page.xhtml

<h:body>

    <h:form id="pcEmulation">

        <p:dataTable id="dataTablePCEMulation"  var="pc" value="#{pCEmulationBean.allPCEmulation}"   

                     rows="10"                         
                     rowsPerPageTemplate="5,30,50,100,200,300"


                     emptyMessage="Não foi encontrado"
                     >


            <f:facet name="header">
                PC Emulation Web
            </f:facet>

            <p:column headerText="PC - TX OLO's"  filterValue="#{pc.filtpcn}" filterMatchMode="contains" filterBy="#{pc.filtpcn}" >                
                <h:outputText value="#{pc.filtpcn}" />
            </p:column>

            <p:column headerText="Rota" sortBy="rota" >                
                <h:outputText value="#{pc.rota}" />
            </p:column>

            <p:column headerText="Origem">                    
                <h:outputText value="#{pc.origem}" />
            </p:column>

            <p:column headerText="Antigo">
                <h:outputText value="#{pc.epcn}" />
            </p:column>

            <p:column headerText="Destino">
                <h:outputText value="#{pc.destino}" />
            </p:column>

            <p:column headerText="PC-Novo">
                <h:outputText value="#{pc.realpcn}" />
            </p:column>


        </p:dataTable>

        <p:blockUI block="dataTablePCEMulation" trigger="dataTablePCEMulation">
            LOADING<br />
            <p:graphicImage value="/images/loading.gif"/><br />
            <p:graphicImage value="/images/tim-banner2.png" width="100px" height="45px"/>
        </p:blockUI>

    </h:form>
</h:body>

Backing-bean:

@ManagedBean
//@ViewScoped
@SessionScoped
public class PCEmulationBean {

    public List<PCEmulation> allPCEmulation;



    public List<PCEmulation> getAllPCEmulation() {
        PCEmulationDAO dao = new PCEmulationDAO();
        try {
            allPCEmulation = dao.getAll();

        } catch (ClassNotFoundException | SQLException e) {
            System.out.println("Problema no metodo list : " + e);
        }

        return allPCEmulation;
    }

}
Nicht verwandt : JSF Ruft Getter mehrere Male, so sollte es nicht enthalten keine Datenbank-Zugriff. es sollte Aussehen, genau so : public X getY() { return y; } stackoverflow.com/questions/2090033/...

InformationsquelleAutor Giovanni Cornachini | 2014-09-12

Schreibe einen Kommentar