简体   繁体   English

p:outputPanel更新后的事件

[英]Event after p:outputPanel being updated

I want to know if there is one ajax event to call a js method when p:outputPanel is being updated? 我想知道在更新p:outputPanel时是否有一个ajax事件来调用js方法?

Because I have one method being called in many parts of code. 因为我在代码的许多部分都调用了一种方法。

To understand, I put title in rowEditor, so when something update this p:outputPanel render again and loose the titles, so I called this method createTitlesRowEditor() in many parts. 为了理解,我将title放置在rowEditor中,因此,当再次更新此p:outputPanel渲染并释放标题时,因此在很多地方都将此方法称为createTitlesRowEditor()

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition template="/template/common/pagelayout.xhtml"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    xmlns:p="http://primefaces.org/ui"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:ez="http://java.sun.com/jsf/composite">


    <ui:define name="content">

        <script type="text/javascript">  

            function disableBtnCorrenteExcluir() {
                $('button[id*="tabelaVigenciaCorrente"]').prop('disabled', true).addClass('ui-state-disabled');
            }

            function enableBtnCorrenteExcluir() {
                $('button[id*="tabelaVigenciaCorrente"]').removeClass('ui-state-disabled');
                createTitlesRowEditor();
            }

            function disableBtnProximaExcluir() {
                $('button[id*="tabelaVigenciaProxima"]').prop('disabled', true).addClass('ui-state-disabled');
            }

            function enableBtnProximaExcluir() {
                $('button[id*="tabelaVigenciaProxima"]').removeClass('ui-state-disabled');
                createTitlesRowEditor();
            }

            function createTitlesRowEditor() {
                $('span[class*="ui-icon-pencil"]').prop('title', 'Editar').addClass('.ui-state-hover');
                $('span[class*="ui-icon-close"]').prop('title', 'Cancelar').addClass('.ui-state-hover');
                $('span[class*="ui-icon-check"]').prop('title', 'Confirmar').addClass('.ui-state-hover');
            }

            function inserirMascara() {
                $('input[class*="hasDatepicker"]').mask('99/99/9999');
            }
        </script>

        <f:metadata>
            <f:event listener="#{tabelaTaxasComissoesEmprestimoBean.load}" type="preRenderView" />
        </f:metadata>

        <div id="content">

            <br />
            <br />

            <div class="form_title">
                <span class="active"><h:outputText
                        value="#{lbl['TITLE.TABELATAXA.FORM.TABELATAXASECOMISSOES']}" /></span>
            </div>

            <h:form id="form">

                <p:messages id="messages" />
                <p:focus/>

                <p:remoteCommand autoRun="true" oncomplete=" createTitlesRowEditor();"/>

                <p:outputPanel id="vigenciaPanel">
                    <div style="margin: 0 auto; width: 70%">
                        <p:dataTable id="tabelaVigenciaCorrente" editable="true"
                            value="#{tabelaTaxasComissoesEmprestimoBean.pojo.vigenciaCorrente.faixas}"
                            emptyMessage="#{lbl['LABEL.TABELATAXA.ADICIONEPELOUMAFAIXA.MSG']}"
                            var="corrente" sortBy="prazoMinimo"
                            rendered="#{tabelaTaxasComissoesEmprestimoBean.pojo.vigenciaCorrente != null}">

                            <p:ajax event="rowEditInit" onstart="disableBtnCorrenteExcluir();" />
                            <p:ajax event="rowEdit" oncomplete="if (args.validationFailed) disableBtnCorrenteExcluir(); else enableBtnCorrenteExcluir();" />
                            <p:ajax event="rowEditCancel" oncomplete="enableBtnCorrenteExcluir();" />

                            <f:facet name="header">
                                <div align="left">
                                    <p:outputLabel
                                        value="#{tabelaTaxasComissoesEmprestimoBean.pojo.vigenciaCorrente} " />
                                    <p:outputLabel
                                        rendered="#{tabelaTaxasComissoesEmprestimoBean.pojo.vigenciaCorrente != null}"
                                        value="#{lbl['LABEL.TABELATAXA.VIGENCIACORRENTE']}" />
                                </div>
                            </f:facet>

                            <p:column headerText="#{lbl['LABEL.TABELATAXA.PRAZOEMMESES']}"
                                styleClass="columnCenter" style="width:25%">
                                <p:cellEditor>
                                    <f:facet name="output">
                                        <p:outputLabel
                                            value="#{corrente.prazoMinimo} #{((corrente.prazoMinimo == corrente.prazoMaximo) || (corrente.prazoMaximo == null)) ? '' : ' a '.concat(corrente.prazoMaximo)}" />
                                    </f:facet>

                                    <f:facet name="input">
                                        <p:inputText id="prazoMinimoCorrente"
                                            label="#{lbl['LABEL.TABELATAXA.PRAZOINICIAL']}"
                                            styleClass="columnRight" value="#{corrente.prazoMinimo}"
                                            size="8" maxlength="3" onkeypress="mascara(this, soNumeros)"
                                            required="true"
                                            title="#{lbl['LABEL.TABELATAXA.PARAPRAZOSIMPLESINFORMESOMENTEOPRAZOINICIAL.HELP']}" />
                                        <p:tooltip for="prazoMinimoCorrente" showEvent="focus"
                                            hideEvent="blur" />
                                        <p:outputLabel value=" a " />
                                        <p:inputText label="#{lbl['LABEL.TABELATAXA.PRAZOFINAL']}"
                                            styleClass="columnRight" value="#{corrente.prazoMaximo}"
                                            size="8" maxlength="3" onkeypress="mascara(this, soNumeros)" />
                                    </f:facet>
                                </p:cellEditor>
                            </p:column>

                            <p:column headerText="#{lbl['LABEL.TABELATAXA.TAXAJUROS']}"
                                styleClass="columnRight">
                                <p:cellEditor>
                                    <f:facet name="output">
                                        <p:outputLabel value="#{corrente.taxaJuros}">
                                            <f:convertNumber locale="pt_BR" minFractionDigits="2"
                                                maxFractionDigits="2" />
                                        </p:outputLabel>
                                        <p:outputLabel value="%" />
                                    </f:facet>

                                    <f:facet name="input">
                                        <p:inputText label="#{lbl['LABEL.TABELATAXA.TAXAJUROS']}"
                                            styleClass="columnRight" value="#{corrente.taxaJuros}"
                                            onkeypress="mascara(this,valorMonetario)" size="11"
                                            maxlength="6" required="true">
                                            <f:convertNumber locale="pt_BR" minFractionDigits="2"
                                                maxFractionDigits="2" />
                                        </p:inputText>
                                    </f:facet>
                                </p:cellEditor>
                            </p:column>

                            <p:column
                                headerText="#{lbl['LABEL.TABELATAXA.TAXADIFERENCIADAOBANCOEMPRESA']}"
                                styleClass="columnRight">
                                <p:cellEditor>
                                    <f:facet name="output">
                                        <p:outputLabel value="#{corrente.taxaDiferenciadaParaBanco}">
                                            <f:convertNumber locale="pt_BR" minFractionDigits="2"
                                                maxFractionDigits="2" />
                                        </p:outputLabel>
                                        <p:outputLabel
                                            value="#{corrente.taxaDiferenciadaParaBanco == null ? '' : '%'}" />
                                    </f:facet>

                                    <f:facet name="input">
                                        <p:inputText
                                            label="#{lbl['LABEL.TABELATAXA.TAXADIFERENCIADAOBANCOEMPRESA']}"
                                            value="#{corrente.taxaDiferenciadaParaBanco}"
                                            styleClass="columnRight"
                                            required="#{tabelaTaxasComissoesEmprestimoBean.pojo.tabelaExclusivaParaCPGarantia}"
                                            onkeypress="mascara(this,valorMonetario)" size="11"
                                            maxlength="6">
                                            <f:convertNumber locale="pt_BR" minFractionDigits="2"
                                                maxFractionDigits="2" />
                                        </p:inputText>
                                    </f:facet>
                                </p:cellEditor>
                            </p:column>

                            <p:column headerText="#{lbl['LABEL.TABELATAXA.COMISSAO']}"
                                styleClass="columnRight">
                                <p:cellEditor>
                                    <f:facet name="output">
                                        <p:outputLabel value="#{corrente.comissao}">
                                            <f:convertNumber locale="pt_BR" minFractionDigits="2"
                                                maxFractionDigits="2" />
                                        </p:outputLabel>

                                        <p:outputLabel value="%" />
                                    </f:facet>

                                    <f:facet name="input">
                                        <p:inputText label="#{lbl['LABEL.TABELATAXA.COMISSAO']}"
                                            value="#{corrente.comissao}" styleClass="columnRight"
                                            onkeypress="mascara(this,valorMonetario)" size="11"
                                            maxlength="6" required="true">
                                            <f:convertNumber locale="pt_BR" minFractionDigits="2"
                                                maxFractionDigits="2" />
                                        </p:inputText>
                                    </f:facet>
                                </p:cellEditor>
                            </p:column>

                            <p:column headerText="#{lbl['LABEL.TABELATAXA.COMPLEMENTO']}"
                                styleClass="columnRight">
                                <p:cellEditor>
                                    <f:facet name="output">
                                        <p:outputLabel value="#{corrente.complementoComissao}">
                                            <f:convertNumber locale="pt_BR" minFractionDigits="2"
                                                maxFractionDigits="2" />
                                        </p:outputLabel>

                                        <p:outputLabel
                                            value="#{corrente.complementoComissao == null ? '' : '%'}" />
                                    </f:facet>

                                    <f:facet name="input">
                                        <p:inputText label="#{lbl['LABEL.TABELATAXA.COMPLEMENTO']}"
                                            value="#{corrente.complementoComissao}"
                                            styleClass="columnRight"
                                            onkeypress="mascara(this,valorMonetario)" size="11"
                                            maxlength="6">
                                            <f:convertNumber locale="pt_BR" minFractionDigits="2"
                                                maxFractionDigits="2" />
                                        </p:inputText>
                                    </f:facet>
                                </p:cellEditor>
                            </p:column>

                            <p:column headerText="#{lbl['LABEL.TABELATAXA.ACAO']}"
                                styleClass="coluna-acao">
                                <p:rowEditor />
                                &nbsp;
                                <p:commandButton process="@this" styleClass="botaoImagem"
                                    icon="botaoExcluir"
                                    title="#{lbl['TITLE.TABELATAXA.FORM.EXCLUIR']}"
                                    oncomplete="confirmationFaixaExclusao.show();">
                                    <f:setPropertyActionListener
                                        target="#{tabelaTaxasComissoesEmprestimoBean.vigenciaTipo}"
                                        value="corrente" />
                                    <f:setPropertyActionListener
                                        target="#{tabelaTaxasComissoesEmprestimoBean.faixa}"
                                        value="#{corrente}" />
                                </p:commandButton>
                            </p:column>

                            <f:facet name="footer">
                                <div align="right">
                                    <p:commandButton
                                        disabled="#{tabelaTaxasComissoesEmprestimoBean.pojo.vigenciaCorrente == null}"
                                        process="@this"
                                        value="#{lbl['BTN.TABELATAXA.ADICIONARFAIXA']}"
                                        update=":dialogAdicionarFaixa" oncomplete="dlgFaixa.show();"
                                        action="#{tabelaTaxasComissoesEmprestimoBean.criarFaixa()}">
                                        <f:setPropertyActionListener
                                            target="#{tabelaTaxasComissoesEmprestimoBean.vigenciaTipo}"
                                            value="corrente" />
                                    </p:commandButton>
                                    &nbsp;&nbsp;
                                    <p:commandButton process="@this" update=":dialogVigencia"
                                        oncomplete="dlgVigencia.show(); createTitlesRowEditor();"
                                        value="#{lbl['BTN.TABELATAXA.EDITARVIGENCIA']}"
                                        action="#{tabelaTaxasComissoesEmprestimoBean.editarVigencia}"
                                        disabled="#{tabelaTaxasComissoesEmprestimoBean.pojo.id ne null}">
                                        <f:setPropertyActionListener
                                            target="#{tabelaTaxasComissoesEmprestimoBean.modoOperacao}"
                                            value="editar" />
                                        <f:setPropertyActionListener
                                            target="#{tabelaTaxasComissoesEmprestimoBean.vigenciaTipo}"
                                            value="corrente" />
                                    </p:commandButton>
                                    &nbsp;&nbsp;
                                    <p:commandButton process="@this" update=":dialogVigencia"
                                        oncomplete="confirmationVigenciaExclusao.show();"
                                        value="#{lbl['BTN.TABELATAXA.EXCLUIRVIGENCIA']}"
                                        disabled="#{tabelaTaxasComissoesEmprestimoBean.pojo.id ne null}">
                                        <f:setPropertyActionListener
                                            target="#{tabelaTaxasComissoesEmprestimoBean.vigenciaTipo}"
                                            value="corrente" />
                                    </p:commandButton>
                                </div>
                            </f:facet>
                        </p:dataTable>

                        <br />

                        <div align="right">
                            <p:commandButton id="btnAdicionarNovaVigencia" process="@this" update="messages :dialogVigencia"
                                actionListener="#{tabelaTaxasComissoesEmprestimoBean.criarVigencia()}"
                                value="#{lbl['BTN.TABELATAXA.ADICIONARVIGENCIA']}">
                                <f:setPropertyActionListener target="#{tabelaTaxasComissoesEmprestimoBean.modoOperacao}" value="inserir"/>
                            </p:commandButton>
                            &nbsp;&nbsp;

                            <p:commandButton id="btnHistoricoVigencias" type="button"
                                value="#{lbl['BTN.TABELATAXA.HISTORICODASVIGENCIAS']}"
                                onclick="blockUIForm.show(); dlgHistoricoVigencias.show(); "
                                rendered="#{tabelaTaxasComissoesEmprestimoBean.pojo.id != null}" />
                        </div>
                    </div>              
                </p:outputPanel>

            </h:form>
        </div>

        <p:dialog id="dialogVigencia" widgetVar="dlgVigencia"
            resizable="false" modal="true" closable="false"
            onHide="createTitlesRowEditor();"
            header="#{tabelaTaxasComissoesEmprestimoBean.vigencia.id eq null ? lbl['LABEL.TABELATAXA.ADICIONARVIGENCIA.HEADER']
            : lbl['LABEL.TABELATAXA.EDITARVIGENCIA.HEADER']}"
            width="30%">
            <h:form id="vigenciaForm">
                <p:messages id="messagesAdicionar" />

                <div class="form_title">
                    <span class="active"><h:outputText
                            value="#{tabelaTaxasComissoesEmprestimoBean.vigencia.id == null ? lbl['LABEL.TABELATAXA.ADICIONARVIGENCIA.HEADER'] : lbl['LABEL.TABELATAXA.EDITARVIGENCIA.HEADER']}" /></span>
                </div>

                <p:panelGrid id="gridVigencia"
                    styleClass="panelGridCenter gridNoBackground noBorders">
                    <p:row>
                        <p:column styleClass="columnRight" width="50%">
                            <p:outputLabel
                                value="#{lbl['LABEL.TABELATAXA.VIGENCIA.DATAINICIAL']}" />
                        </p:column>

                        <p:column width="50%">
                            <p:calendar
                                label="#{lbl['LABEL.TABELATAXA.VIGENCIA.DATAINICIAL']}"
                                value="#{tabelaTaxasComissoesEmprestimoBean.vigencia.dataInicial}"
                                pattern="dd/MM/yyyy" mode="popup" required="true" locale="pt_BR"
                                size="16" onfocus="inserirMascara();" />
                        </p:column>
                    </p:row>

                    <p:row
                        rendered="#{tabelaTaxasComissoesEmprestimoBean.vigencia.dataFinal != null and tabelaTaxasComissoesEmprestimoBean.vigencia.id != null}">
                        <p:column styleClass="columnRight">
                            <p:outputLabel
                                value="#{lbl['LABEL.TABELATAXA.VIGENCIA.DATAFINAL']}" />
                        </p:column>

                        <p:column>
                            <p:calendar label="#{lbl['LABEL.TABELATAXA.VIGENCIA.DATAFINAL']}"
                                value="#{tabelaTaxasComissoesEmprestimoBean.vigencia.dataFinal}"
                                pattern="dd/MM/yyyy" mode="popup" disabled="true" locale="pt_BR"
                                size="16" />
                        </p:column>
                    </p:row>
                </p:panelGrid>

                <div class="form_title" />

                <div align="right">
                    <p:commandButton process="vigenciaForm"
                        value="#{lbl['BTN.TABELATAXA.CONFIRMAR']}"
                        actionListener="#{tabelaTaxasComissoesEmprestimoBean.salvarVigencia()}"
                        oncomplete="createTitlesRowEditor();"
                        update=":form:vigenciaPanel messagesAdicionar gridVigencia @parent :form:btnAdicionarNovaVigencia" />
                    &nbsp;&nbsp;
                    <p:commandButton type="button"
                        value="#{lbl['BTN.TABELATAXA.CANCELAR']}"
                        onclick="confirmDialogCancelViagencia.show();" />
                </div>
            </h:form>
        </p:dialog>

        <p:confirmDialog message="#{lbl['LABEL.TABELATAXA.DESEJAREALMENTECANCELAR.MSG']}"
            header="#{lbl['LABEL.TABELATAXA.CONFIRMACAOCANCELAMENTO.HEADER']}" severity="alert"
            widgetVar="confirmDialogCancelViagencia">
            <p:commandButton process="@this" value="#{lbl['BTN.TABELATAXA.SIM']}"
                update=":form:vigenciaPanel"
                oncomplete="createTitlesRowEditor();"
                onclick="dlgVigencia.hide(); confirmDialogCancelViagencia.hide();">
                <p:ajax event="click" listener="#{tabelaTaxasComissoesEmprestimoBean.resetDialog(':dialogVigencia')}" />
            </p:commandButton>

            <p:commandButton type="button" value="#{lbl['BTN.TABELATAXA.NAO']}"
                onclick="confirmDialogCancelViagencia.hide();" />
        </p:confirmDialog>

        <p:confirmDialog showEffect="false"
            message="#{lbl['LABEL.TABELATAXA.DESEJAREALMENTEEXCLUIRESTAVIGENCIA.MSG']}"
            header="#{lbl['LABEL.TABELATAXA.CONFIRMACAOEXCLUSAO.HEADER']}"
            widgetVar="confirmationVigenciaExclusao">
            <p:commandButton process="@this" value="#{lbl['BTN.TABELATAXA.SIM']}"
                actionListener="#{tabelaTaxasComissoesEmprestimoBean.removerVigencia()}"
                oncomplete="confirmationVigenciaExclusao.hide(); createTitlesRowEditor(); window.scrollTo(0, 0);"
                update=":form:vigenciaPanel :form:messages" />

            <p:commandButton type="button" value="#{lbl['BTN.TABELATAXA.NAO']}"
                onclick="confirmationVigenciaExclusao.hide();" />
        </p:confirmDialog>

        <p:dialog id="dialogAdicionarFaixa" header="#{lbl['LABEL.TABELATAXA.ADICIONARFAIXA.HEADER']}"
            widgetVar="dlgFaixa" resizable="false" modal="true" closable="false">
            <h:form id="faixaForm">
                <p:messages id="messagesAdicionar" />

                <div class="form_title">
                    <span class="active"><h:outputText value="#{lbl['TITLE.TABELATAXA.FORM.ADICIONARFAIXA']}" /></span>
                </div>

                <p:panelGrid id="gridFaixa"
                    styleClass="panelGridCenter noBorders gridNoBackground">
                    <p:row>
                        <p:column styleClass="columnRight">
                            <p:outputLabel value="#{lbl['LABEL.TABELATAXA.PRAZO']}" />
                        </p:column>

                        <p:column>
                            <p:inputText label="#{lbl['LABEL.TABELATAXA.PRAZOINICIAL']}"
                                styleClass="columnRight"
                                value="#{tabelaTaxasComissoesEmprestimoBean.faixa.prazoMinimo}"
                                size="11" maxlength="3" onkeypress="mascara(this, soNumeros)"
                                required="true" />
                                &nbsp;
                            <p:outputLabel value="a" />
                        </p:column>

                        <p:column style="padding-left: 0">
                            <p:inputText label="#{lbl['LABEL.TABELATAXA.PRAZOFINAL']}"
                                styleClass="columnRight"
                                value="#{tabelaTaxasComissoesEmprestimoBean.faixa.prazoMaximo}"
                                size="11" maxlength="3" onkeypress="mascara(this, soNumeros)"/>
                        </p:column>

                        <p:column styleClass="noPadding">
                            <p:outputLabel value="#{lbl['LABEL.TABELATAXA.MESES']}" />
                        </p:column>

                        <p:column>
                            <p:graphicImage url="#{resource['images:help-icon.png']}"
                                title="#{lbl['LABEL.TABELATAXA.PARAPRAZOSIMPLESINFORMESOMENTEOPRAZOINICIAL.HELP']}" />
                        </p:column>
                    </p:row>

                    <p:row>
                        <p:column styleClass="columnRight">
                            <p:outputLabel value="#{lbl['LABEL.TABELATAXA.TAXAJUROS']}" />
                        </p:column>

                        <p:column>
                            <p:inputText label="#{lbl['LABEL.TABELATAXA.TAXAJUROS']}"
                                styleClass="columnRight"
                                value="#{tabelaTaxasComissoesEmprestimoBean.faixa.taxaJuros}"
                                onkeypress="mascara(this,valorMonetario)" size="11"
                                maxlength="6" required="true">
                                <f:convertNumber locale="pt_BR" minFractionDigits="2"
                                    maxFractionDigits="2" />
                            </p:inputText>
                            <p:outputLabel value=" %" />
                        </p:column>
                    </p:row>

                    <p:row>
                        <p:column styleClass="columnRight">
                            <p:outputLabel value="#{lbl['LABEL.TABELATAXA.TAXADIFERENCIADAOBANCOEMPRESA']}" />
                        </p:column>

                        <p:column>
                            <p:inputText
                                label="#{lbl['LABEL.TABELATAXA.TAXADIFERENCIADAOBANCOEMPRESA']}"
                                styleClass="columnRight"
                                value="#{tabelaTaxasComissoesEmprestimoBean.faixa.taxaDiferenciadaParaBanco}"
                                required="#{tabelaTaxasComissoesEmprestimoBean.pojo.tabelaExclusivaParaCPGarantia}"
                                onkeypress="mascara(this,valorMonetario)" size="11"
                                maxlength="6">
                                <f:convertNumber locale="pt_BR" minFractionDigits="2"
                                    maxFractionDigits="2" />
                            </p:inputText>
                            <p:outputLabel value=" %" />
                        </p:column>
                    </p:row>

                    <p:row>
                        <p:column styleClass="columnRight">
                            <p:outputLabel value="#{lbl['LABEL.TABELATAXA.COMISSAO']}" />
                        </p:column>

                        <p:column>
                            <p:inputText label="#{lbl['LABEL.TABELATAXA.COMISSAO']}"
                                styleClass="columnRight"
                                value="#{tabelaTaxasComissoesEmprestimoBean.faixa.comissao}"
                                onkeypress="mascara(this,valorMonetario)" size="11"
                                maxlength="6" required="true">
                                <f:convertNumber locale="pt_BR" minFractionDigits="2"
                                    maxFractionDigits="2" />
                            </p:inputText>
                            <p:outputLabel value=" %" />
                        </p:column>
                    </p:row>

                    <p:row>
                        <p:column styleClass="columnRight">
                            <p:outputLabel value="#{lbl['LABEL.TABELATAXA.COMPLEMENTO']}" />
                        </p:column>

                        <p:column>
                            <p:inputText label="#{lbl['LABEL.TABELATAXA.COMPLEMENTO']}"
                                styleClass="columnRight"
                                value="#{tabelaTaxasComissoesEmprestimoBean.faixa.complementoComissao}"
                                onkeypress="mascara(this,valorMonetario)" size="11"
                                maxlength="6">
                                <f:convertNumber locale="pt_BR" minFractionDigits="2"
                                    maxFractionDigits="2" />
                            </p:inputText>
                            <p:outputLabel value=" %" />
                        </p:column>
                    </p:row>
                </p:panelGrid>

                <div class="form_title" />

                <div align="right">
                    <p:commandButton process="faixaForm" value="#{lbl['BTN.TABELATAXA.CONFIRMAR']}"
                        oncomplete="if (!args.validationFailed) dlgFaixa.hide(); createTitlesRowEditor();"
                        update=":form:vigenciaPanel messagesAdicionar gridFaixa @parent">
                        <p:collector unique="false" addTo="#{tabelaTaxasComissoesEmprestimoBean.faixasVigencia}"
                            value="#{tabelaTaxasComissoesEmprestimoBean.faixa}" />
                    </p:commandButton>
                    &nbsp;&nbsp;
                    <p:commandButton type="button" value="#{lbl['BTN.TABELATAXA.CANCELAR']}"
                        onclick="confirmDialogCancelFaixa.show();" />
                </div>
            </h:form>
        </p:dialog>

        <p:confirmDialog message="#{lbl['LABEL.TABELATAXA.DESEJAREALMENTECANCELAR.MSG']}"
            header="#{lbl['LABEL.TABELATAXA.CONFIRMACAOCANCELAMENTO.HEADER']}" severity="alert"
            widgetVar="confirmDialogCancelFaixa">
            <p:commandButton process="@this" type="button" value="#{lbl['BTN.TABELATAXA.SIM']}"
                onclick="dlgFaixa.hide(), confirmDialogCancelFaixa.hide();">
                <p:ajax event="click" listener="#{tabelaTaxasComissoesEmprestimoBean.resetDialog(':dialogAdicionarFaixa')}" />
            </p:commandButton>

            <p:commandButton type="button" value="#{lbl['BTN.TABELATAXA.NAO']}"
                onclick="confirmDialogCancelFaixa.hide();" />
        </p:confirmDialog>

        <p:confirmDialog showEffect="false"
            message="#{lbl['LABEL.TABELATAXA.DESEJAREALMENTEEXCLUIRESTAFAIXAVIGENCIA.MSG']}"
            header="#{lbl['LABEL.TABELATAXA.CONFIRMACAOEXCLUSAO.HEADER']}" widgetVar="confirmationFaixaExclusao">
            <p:commandButton process="@this" value="#{lbl['BTN.TABELATAXA.SIM']}"
                oncomplete="confirmationFaixaExclusao.hide(); createTitlesRowEditor(); window.scrollTo(0, 0);"
                update=":form:vigenciaPanel :form:messages">
                <p:collector removeFrom="#{tabelaTaxasComissoesEmprestimoBean.faixasVigencia}"
                    value="#{tabelaTaxasComissoesEmprestimoBean.faixa}" />
            </p:commandButton>

            <p:commandButton type="button" value="#{lbl['BTN.TABELATAXA.NAO']}"
                onclick="confirmationFaixaExclusao.hide();" />
        </p:confirmDialog>

        <p:dialog header="#{lbl['LABEL.TABELATAXA.HISTORICODATABELA.HEADER']}"
            widgetVar="dlgLog" resizable="false" modal="true" height="450"
            onShow="blockUIForm.hide();" width="1000" dynamic="true">
            <ui:include src="#{tabelaTaxasComissoesEmprestimoBean.viewLog}" />
        </p:dialog>

        <p:confirmDialog id="confirmDialogCancelForm"
            message="#{lbl['LABEL.TABELATAXA.DESEJAREALMENTECANCELAR.MSG']}"
            header="#{lbl['LABEL.TABELATAXA.CONFIRMACAOCANCELAMENTO.HEADER']}" severity="alert"
            widgetVar="cancelConfirmationForm">

            <p:commandButton process="confirmDialogCancelForm"
                value="#{lbl['BTN.TABELATAXA.SIM']}" action="#{tabelaTaxasComissoesEmprestimoBean.cancelar}"
                oncomplete="cancelConfirmationForm.hide();" />

            <p:commandButton type="button" value="#{lbl['BTN.TABELATAXA.NAO']}"
                onclick="cancelConfirmationForm.hide();" />
        </p:confirmDialog>

        <p:dialog header="#{lbl['LABEL.TABELATAXA.HISTORICODASVIGENCIAS.HEADER']}" widgetVar="dlgHistoricoVigencias"
                    resizable="false" modal="true" height="500" width="1000" dynamic="true" onShow="blockUIForm.hide()">
            <ui:include src="#{tabelaTaxasComissoesEmprestimoBean.getViewVigenciasLog()}" />
        </p:dialog> 

    </ui:define>    
</ui:composition>

Thanks 谢谢

You can add the JavaScript you would like to execute to the p:outputPanel , so you do not need the p:remoteCommand with autoRun="true" and the JS gets executed everytime the outputPanel gets updated: 您可以将要执行的JavaScript添加到p:outputPanel ,因此不需要带有autoRun="true"p:remoteCommand ,并且每次outputPanel更新时都将执行JS:

<p:outputPanel id="vigenciaPanel">
    ...
    <script type="text/javascript">
        $(document).ready(createTitlesRowEditor);
    </script>
</p:outputPanel>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM