title: Update component after file download
body: <p>I'm using Primefaces TabView, CommandButton and FileDownload to download a log file. Once the log file has been downloaded, I want to offer the option to delete the contents of the log from the server.</p>
  
  <p>Initially the Delete Log File Button (deleteEventLogButton) is disabled and has a custom caption stating "Delete Logs - Export Required".  Once the log has been exported, the button should be enabled and the caption should state "Delete Logs".</p>
  
  <p>The problem that I'm having is that the Delete Log File Button is still disabled and the caption reads "Delete Logs - Export Required" even after the Export event completes successfully.</p>
  
  <p>My guess is that the exportEventLogButton->Update="deleteEventLogButton" is being called before the fileDownload value.</p>
  
  <p>Once I've exported the logs, I can hit 'F5' and refresh the page and the deleteEventLogButton is enabled showing the correct caption.</p>
  
  <p><strong>JSF - Snippet</strong> </p>
  
  <pre><code>&lt;p:tabView id="logView"&gt;
      &lt;p:tab id="eventLogTab" title="Security Events"&gt;
          &lt;p:panelGrid ...&gt;
  
              &lt;p:commandButton id="exportEventLogButton" icon="ui-icon-disk" styleClass="c25" ajax="false" title="Export Log" disabled="#{empty managedCmsLogsBean.eventLogEntityList}" update="deleteEventLogButton"&gt;
                  &lt;p:fileDownload value="#{managedCmsLogsBean.exportEventLogFiles()}"/&gt;
              &lt;/p:commandButton&gt;
  
              &lt;p:commandButton id="deleteEventLogButton" icon="ui-icon-trash" styleClass="c25" ajax="false" title="#{managedCmsLogsBean.deleteEventLogCaption}" disabled="#{! managedCmsLogsBean.eventLogExported}" action="#{managedCmsLogsBean.clearEventLogs()}" update="eventLogTab" /&gt;    
  
          &lt;/p:panelGrid&gt;
  
          &lt;p:dataTable value="#{managedCmsLogsBean.eventLogEntityList}" ...&gt;
              ...
          &lt;/p:dataTable&gt;
  
      &lt;/p:tab&gt;
  &lt;/p:tabView&gt;
  </code></pre>
  
  <p><strong>Backing Bean - Snippet</strong></p>
  
  <pre><code>private boolean eventLogExported;
  
  public StreamedContent exportEventLogFiles() {
      eventLogExported = true;
      return logFileUtility.exportSecurityEventLog(eventLogEntityList, eventLogStartDate, eventLogStopDate);
  }
  
  public boolean isEventLogExported() {
      return eventLogExported;
  }
  
  public void setEventLogExported(boolean value) {
      eventLogExported = value;
  }
  
  public String getDeleteEventLogCaption() {
      return eventLogExported ? "Delete Logs" : "Delete Logs - Export Required";
  }
  </code></pre>
  
  <p>I tried moving the update event inside the FileDownload, but it didn't make a difference.</p>
  
  <pre><code>&lt;p:commandButton id="exportEventLogButton" icon="ui-icon-disk" styleClass="c25" ajax="false" title="Export Log" disabled="#{empty managedCmsLogsBean.eventLogEntityList}"&gt;
      &lt;p:fileDownload value="#{managedCmsLogsBean.exportEventLogFiles()}"&gt;
          &lt;p:ajax update="deleteEventLogButton"/&gt;
      &lt;/p:fileDownload&gt;
  &lt;/p:commandButton&gt;
  </code></pre>
  
  <p>I've searched for a couple of days now and have found MANY problems that come very close to this one... but none that have helped.  :(</p>
  
  <p>Just to make things very clear... I am NOT having problems with the export.  The problem is that the Delete Log File Button is not enabled after the export is complete.</p>