Hello, I am doing an upload and download of a txt. When I click on "Download" the txt, it is downloaded, and I set some variables, later another panel must be rendered, my problem is that I download the file and the panel is not rendered, if I click on download again, then the panel is rendered. I hope you understand me .
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 should 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>
Wrap the panel to render in another panel, give it an id and render this panel, instead of the inner one.
In your commandButton: