Update panel after download file

0

Hi, I'm doing a loading and unloading of a txt. When I click on "Download" the txt, it is downloaded, and I set some variables, then another panel must be rendered, my problem is that I download the file and the panel is not rendered, if I click again to download, then the panel is rendered. I hope to give me to understand.

Panel with buttons:

<p:panel styleClass="panelGridConsulta">
    <div class="panelGrid botonesFlujoCaptcha">
        <p:commandButton styleClass="estilo" value="Terminar"
                         actionListener="#{bean.reset}" ajax="false"/>

        <p:commandButton id="comdDwn" value="Descargar archivo"
                         actionListener="#{fileBean.resetValida}" ajax="false"
                         disabled="#{fileBean.status ==null or bean.statusBtnDescargarArchivo ==null}"
                         update="panelDwn" styleClass="estilo">
            <p:fileDownload value="#{fileBean.file}" />
        </p:commandButton>
    </div>
</p:panel>

Method in MB:

public void resetValida() {
    setStatus(null);
    setStatusDownload("Favor de seleccionar y validar un archivo.");
    terminarMasiva = "activo descarga";
    RequestContext.getCurrentInstance().update("terminaDescargaArch");

}

Panel that must be rendered once the txt is downloaded:

<p:panel id="terminaDescargaArch" styleClass="panelGridConsulta"
rendered="#{uploadFileBean.terminarMasiva != null}">
    <h:outputLabel styleClass="txtLabel izq3"
                   value="Test render after download:"/>
</p:panel>
    
asked by Ventur 10.06.2016 в 21:20
source

1 answer

1

Circle in panel to render in another panel, place an id and render this panel, instead of the internal one.

<p:panel id="terminaDescargaArch" styleClass="panelGridConsulta">
    <p:panel rendered="#{fileUploadBean.terminaMasiva =! null}">
        ...
    </p:panel>
</p:panel>

On your commandButton:

<p:commandButton .... update="terminaDescargaArch" />
    
answered by 11.06.2016 / 00:09
source