title: primefaces: how to show an overlayPanel when a task finishes
body: <p>I'm trying to show an overlayPanel after a java code is executed</p>
  
  <p>something like this:</p>
  
  <pre><code>&lt;p:commandButton id="btn" type="submit" actionListener="#{document.doSomething}" ajax="true"/&gt;
  
  &lt;p:overlayPanel showEvent="oncomplete" for="btn"  appendToBody="true"&gt; 
  ....                    
  &lt;/p:overlayPanel&gt;
  </code></pre>
  
  <p>I'd like the overlayPanel to be shown after document.doSomething finish.</p>
  
  <p>I'm trying in many ways, but I can't. If I change the "oncomplete" ShowEvent by "click", then the panel is shown, but before document.doSomething finish.</p>
  
  <p>How can I achieve this?</p>
  
  <p>Thanks in advance</p>