Use data table with resource on demand within a dialog in the firstfaces

0

I am having difficulty using datatable of primefaces with that resource on demand . I try to use it within dialog but when opening with the data, but they are not updated and scroll of the mouse moves the previous page because I'm using modal = "true" .

Has anyone ever managed to do such a thing?

Code of dialog

<p:dialog header="#{lbl['LABEL.TABELATAXA.HISTRICODATABELA.HEADER']}"
    widgetVar="dlgLog" resizable="false" modal="true" height="500"
    width="1000" dynamic="true">
    <ui:include src="#{tabelaTaxasComissoesEmprestimoBean.viewLog}" />
</p:dialog>

Viewlog Code

<html xmlns="http://www.w3.org/1999/xhtml"
      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">

    <h:head/>

    <h:body>
        <p:dataTable var="log" value="#{tabelaTaxasComissoesEmprestimoBean.logs}"
            emptyMessage="#{lbl['LABEL.TABELATAXA.NAOHAREGISTROLOG.MSG']}"
            styleClass="dataTableNoWrap" scrollRows="15" scrollable="true"
            liveScroll="true" scrollHeight="400" scrollWidth="2500">

            <p:column headerText="#{lbl['LABEL.TABELATAXA.DATAHORA']}"
                styleClass="columnCenter">
                <h:outputText value="#{log.dataHora}">
                    <f:convertDateTime pattern="dd/MM/yyyy - HH:mm" />
                </h:outputText>
            </p:column>

            <p:column headerText="#{lbl['LABEL.TABELATAXA.USUARIO']}">
                <h:outputText value="#{log.usuario.login}" />
            </p:column>

            <p:column headerText="#{lbl['LABEL.TABELATAXA.OPERACAO']}">
                <h:outputText value="#{log.operacao}" />
            </p:column>

            <p:column headerText="#{lbl['LABEL.TABELATAXA.DESATIVADO']}"
                styleClass="columnCenter">
                <h:outputText value="#{log.desativada}" converter="boolConverter" />
            </p:column>

            <p:column headerText="#{lbl['LABEL.TABELATAXA.NOME']}">
                <h:outputText value="#{log.nome}" />
            </p:column>

            <p:column headerText="#{lbl['LABEL.TABELATAXA.DESATIVADA']}"
                styleClass="columnCenter">
                <h:outputText value="#{log.desativada}" converter="boolConverter" />
            </p:column>

            <p:column
                headerText="#{lbl['LABEL.TABELATAXA.TABELANAOPODESERVINCULADAASLOJAS']}"
                styleClass="columnCenter">
                <h:outputText value="#{log.tabelaNaoPodeSerVinculadaLojas}" converter="boolConverter" />
            </p:column>

            <p:column
                headerText="#{lbl['LABEL.TABELATAXA.TABELAEXCLUSIVACPGARANTIA']}"
                styleClass="columnCenter">
                <h:outputText value="#{log.tabelaExclusivaParaCPGarantia}" converter="boolConverter" />
            </p:column>

            <p:column
                headerText="#{lbl['LABEL.TABELATAXA.TABELAUTILIZADAFINANCIAMENTOVEICULOS']}"
                styleClass="columnCenter">
                <h:outputText value="#{log.tabelaUtilizadaParaFinanciamentoVeiculos}" converter="boolConverter" />
            </p:column>

            <p:column
                headerText="#{lbl['LABEL.TABELATAXA.ANOFABRICACAODOVEICULO']}">
                <h:outputText value="#{log.anoFabricacaoVeiculoMin} - #{log.anoFabricacaoVeiculoMax}" />
            </p:column>

            <p:column
                headerText="#{lbl['LABEL.TABELATAXA.FINANCIAMENTOPERMITIDOOVALORDOVEICULO']}"
                styleClass="columnRight">
                <h:outputText value="#{log.financiamentoPermitidoSobreValorVeiculo}">
                    <f:convertNumber locale="pt_BR" minFractionDigits="2"
                        maxFractionDigits="2" type="percent" />
                </h:outputText>
            </p:column>

            <p:column
                headerText="#{lbl['LABEL.TABELATAXA.ENDIVIDAMENTOPERMITIDOARENDA']}"
                styleClass="columnRight">
                <h:outputText value="#{log.endividamentoPermitidoSobreRenda}">
                    <f:convertNumber locale="pt_BR" minFractionDigits="2"
                        maxFractionDigits="2" type="percent" />
                </h:outputText>
            </p:column>

        </p:dataTable>
    </h:body>
</html>

I'm using primefaces 4.0 .

    
asked by anonymous 17.07.2014 / 18:46

1 answer

1

I was able to make the live scroll work by setting a appendTo="@(body)" to p:dialog and increasing the number of rows in the table to 50: scrollRows="50" . That is, an amount that requires the scroll.

With a small number of rows the vertical scroll bar was not displayed, so it was not possible to scroll to the end of the table to load more rows.

    
07.08.2014 / 21:23