PrimeTaces dataTable SortBy does not work

1

Good day, people. I am new here in the forum and would like to have the help of you for the following situation. The sortBy of my datatable is not working properly. The dataTable simply loses its table format and displays the inline content. In some pages it appears normal, but in others it loses the setting.

I'm using Primefaces 5.3. Thanks for all the help

                xmlns: h="http://java.sun.com/jsf/html"
                xmlns: f="http://java.sun.com/jsf/core"
                xmlns: ui="http://java.sun.com/jsf/facelets"
                xmlns: p="http://primefaces.org/ui"
                template="/ template / template / templateCity.xhtml" >

<ui:define name="conteudo" >       
    <h:form id="formGeral">
        <p:panel id="parlamentares" header="Parlamentares" class="panel-height-front panel-border-color">
            <p:outputPanel autoUpdate="true" class="ui-fluid">
                <p:panelGrid id="panelPeriodo" columns="1" layout="grid" columnClasses="ui-grid-col-12" class="panelgrid-noborder">
                    <p:outputLabel value="Período de Legislatura"/>
                    <p:selectOneMenu value="#{cidadaoParlamentaresBean.periodoSelecionado}" class="panelgrid-item-width-min20max40">  
                        <f:selectItem itemLabel="Selecione" itemValue=""/>
                        <f:selectItems itemLabel="#{per.periodoNome}" itemValue="#{per.periodoNome}" value="#{cidadaoParlamentaresBean.periodos}" var="per"/>
                        <p:ajax event="change" listener="#{cidadaoParlamentaresBean.consultarParlamentarPorPeriodo()}" update="dtParlamentares"/>
                    </p:selectOneMenu>
                </p:panelGrid>
            </p:outputPanel>

            <p:dataTable id="dtParlamentares" value="#{cidadaoParlamentaresBean.membros}" var="parlamentar"  rowStyleClass="#{cont %2!=0 ? 'old' : null}" 
                         rowIndexVar="cont" styleClass="background_datatable"
                         emptyMessage="Não Há Parlamentares Cadastrados" scrollRows="50"  scrollable="true" scrollHeight="400" sortBy="#{parlamentar.membrosUserCodigo.userNomeusuario}" 
                         selection="#{cidadaoParlamentaresBean.membroSelecionado}" rowKey="#{parlamentar.membrosCodigo}"
                         paginator="true" paginatorPosition="top" paginatorTemplate="{Exporters}"
                         reflow="true" class="margin-top background_datatable">

                <f:facet name="{Exporters}">
                    <nav class="export-icons-nav">
                        <h:commandLink styleClass="export-icons-commandLink">
                            <p:graphicImage library="img" title="xls" name="exp_xls.png" styleClass="export-icons-img"/>
                            <p:dataExporter type="xls" target="dtParlamentares" fileName="parlamentares" pageOnly="true"/>
                        </h:commandLink>

                        <h:commandLink styleClass="export-icons-commandLink">
                            <p:graphicImage library="img" title="pdf" name="exp_pdf.png" styleClass="export-icons-img"/>
                            <p:dataExporter type="pdf" target="dtParlamentares" fileName="parlamentares" pageOnly="false"/>
                        </h:commandLink>

                        <h:commandLink styleClass="export-icons-commandLink">
                            <p:graphicImage library="img" title="csv" name="exp_csv.png" styleClass="export-icons-img"/>
                            <p:dataExporter type="csv" target="dtParlamentares" fileName="parlamentares"  />
                        </h:commandLink>

                        <h:commandLink styleClass="export-icons-commandLink">
                            <p:graphicImage library="img" title="xml" name="exp_xml.png" styleClass="export-icons-img"/>
                            <p:dataExporter type="xml" target="dtParlamentares" fileName="parlamentares"  />
                        </h:commandLink>
                    </nav>
                    <div style="clear: both"></div>
                </f:facet>

                <p:column headerText="Nome" sortBy="#{parlamentar.membrosUserCodigo.userNomeusuario}" >
                    <p:commandLink action="#{cidadaoParlamentaresBean.carregarDialogCuriculo()}" value="#{parlamentar.membrosUserCodigo.userNomeusuario}">
                        <f:setPropertyActionListener value="#{parlamentar}" target="#{cidadaoParlamentaresBean.membroSelecionado}"/>
                    </p:commandLink>
                </p:column>

                <p:column headerText="Apelido" sortBy="#{parlamentar.membrosUserCodigo.userApelido}">
                    <p:outputLabel value="#{parlamentar.membrosUserCodigo.userApelido}"/>
                </p:column>

                <p:column headerText="Email" sortBy="#{parlamentar.membrosUserCodigo.userEmail}">
                    <p:outputLabel value="#{parlamentar.membrosUserCodigo.userEmail}"/>
                </p:column>
            </p:dataTable>

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

    <p:dialog id="dlgCurriculo" header="Currículo Parlamentar" widgetVar="widCurriculo"  appendTo="@(BODY)" resizable="false" modal="true" closeOnEscape="true" dynamic="true"
              visible="#{cidadaoParlamentaresBean.abrirCurriculo}" class="dialog-width"  >
        <h:form id="formDialog">

            <ui:include src="/telas/cidadao/CurriculoParlamentar.xhtml"/>

        </h:form>
    </p:dialog>

</ui:define>

    
asked by anonymous 27.12.2017 / 14:39

0 answers