Problem with p: dataTable, ajax, ui: include

1

I'm having a problem, I have a p: dataTable that does not work "sortBy", nor pagination. When I test the code of this table on a simple page it works, however when I use it in my project it does not work. In my project I call the page that has the table through a the table looks for the data of the bean, but neither sorting nor paging works. I am using CDI with @Named, @ViewScope and @Inject, I have already tested with other scopes and the result is the same :(

Table Code:

<h:form>    
<p:dataTable value="#{moduloController.modulos}" var="m" id="tabModulos"
                        emptyMessage="Nenhum módulo localizado." paginator="true" rows="10"
                        paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
                        rowsPerPageTemplate="5,10,15">

                        <p:column  headerText="Nome" width="40%" sortBy="#{m.nome}">
                            <h:outputText value="#{m.nome}" />
                        </p:column>

                        <p:column  headerText="Descrição" width="40%" sortBy="#{m.descricao}">
                            <h:outputText value="#{m.descricao}" />
                        </p:column>


                        <p:column headerText="Módulo Principal" width="20%" 
                            styleClass="align-center" sortBy="#{m.topModulo.nome}">
                            <h:outputText value="#{m.topModulo.nome}" />
                        </p:column>                 

                    </p:dataTable>
</h:form>

The insertion of the page that contains the table is done through the following code:

            <h:panelGroup id="painelConteudo" layout="block">
                <ui:include src="#{menuController.pageLink}.xhtml"/>
            </h:panelGroup>

Testing this table code on an ordinary page works perfectly.

Comparing the debug, via the Chrome developer tools I realized that on the page that is added, ajax does not call the update element;

Follow the debug from the page that does not work:

<partial-response id="j_id1">
<changes>
<update id="j_id1:javax.faces.ViewState:0">-8477971442835400176:4133945171221710420</update>
</changes>
</partial-response>

and now debug the simple page ... where you can view the table to be sorted.

<partial-response id="j_id1">
<changes>
<update id="form:j_idt14"><tr data-ri="0" class="ui-widget-content ui-datatable-even" role="row"><td role="gridcell">Administrativo</td><td role="gridcell">Módulo de Administração do Sistema</td><td role="gridcell" class="align-center"></td></tr><tr data-ri="1" class="ui-widget-content ui-datatable-odd" role="row"><td role="gridcell">Caixa</td><td role="gridcell">Gerencie o caixa</td><td role="gridcell" class="align-center"></td></tr><tr data-ri="2" class="ui-widget-content ui-datatable-even" role="row"><td role="gridcell">Calendário</td><td role="gridcell">Agende seus compromissos</td><td role="gridcell" class="align-center"></td></tr><tr data-ri="3" class="ui-widget-content ui-datatable-odd" role="row"><td role="gridcell">Cargos</td><td role="gridcell">Cadastro de Cargos</td><td role="gridcell" class="align-center">Administrativo</td></tr><tr data-ri="4" class="ui-widget-content ui-datatable-even" role="row"><td role="gridcell">CFOP</td><td role="gridcell">Cadastro de CFOP</td><td role="gridcell" class="align-center">Administrativo</td></tr><tr data-ri="5" class="ui-widget-content ui-datatable-odd" role="row"><td role="gridcell">Clientes</td><td role="gridcell">Cadastro de Clientes</td><td role="gridcell" class="align-center">Administrativo</td></tr><tr data-ri="6" class="ui-widget-content ui-datatable-even" role="row"><td role="gridcell">Colaboradores</td><td role="gridcell">Cadastro de Colaboradores</td><td role="gridcell" class="align-center">Administrativo</td></tr><tr data-ri="7" class="ui-widget-content ui-datatable-odd" role="row"><td role="gridcell">Compras</td><td role="gridcell">Gerencie de compra de insumos e produtos</td><td role="gridcell" class="align-center"></td></tr><tr data-ri="8" class="ui-widget-content ui-datatable-even" role="row"><td role="gridcell">Contas a Pagar</td><td role="gridcell">Gerencie as contas a pagar</td><td role="gridcell" class="align-center"></td></tr><tr data-ri="9" class="ui-widget-content ui-datatable-odd" role="row"><td role="gridcell">Contas a Receber</td><td role="gridcell">Gerencie as contas a receber</td><td role="gridcell" class="align-center"></td></tr></update>
<update id="j_id1:javax.faces.ViewState:0">4054556111108695514:3140532311518801280</update>
<extension ln="primefaces" type="args">{"totalRecords":27}</extension>
</changes>
</partial-response>

It's as if primefaces is not locating the form. I already placed the form inside the page to be included and also in the page that inserts, the result is the same ... that is, neither sorting nor pagination works in this case. Anyone have any suggestions on how to solve?

    
asked by anonymous 18.11.2016 / 20:15

0 answers