Update component after file download

p:commandButton in your case is (an has to be) non-AJAX button (you set this by adding ajax="false" attribute). In that case update attribute and p:ajax tag doesn’t have any sense (as they are only for AJAX requests). When you have file download your application sends streaming of some type, and you see Save File dialog. Your page is not refreshed. So you have to use PrimeFaces.monitorDownload to do this:

<p:commandButton id="exportEventLogButton" 
                 icon="ui-icon-disk" 
                 styleClass="c25" 
                 ajax="false" 
                 title="Export Log" 
                 disabled="#{empty managedCmsLogsBean.eventLogEntityList}"
                 onclick="PrimeFaces.monitorDownload(null, stop)">

and add stop function which will update second button:

<p:remoteCommand name="stop" update="deleteEventLogButton"/>

Leave a Comment