Update panel after download file


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}" />

Method in MB:

public void resetValida() {
    setStatusDownload("Favor de seleccionar y validar un archivo.");
    terminarMasiva = "activo descarga";


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:"/>
asked by Ventur 10.06.2016 в 21:20

1 answer


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}">

On your commandButton:

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