title: Conditionally open global p:confirmDialog with p:confirm
body: <p>I want to open a global <a href="http://www.primefaces.org/showcase/ui/overlay/confirmDialog.xhtml" rel="nofollow noreferrer"><code>p:confirmDialog</code></a> based on a bean boolean value. I would like to have something like this:</p>
  
  <pre><code>&lt;p:commandButton value="Save" actionListener="#{bean.save}" 
                   update="@form" oncomplete="jsfunction();"&gt;
      &lt;p:confirm header="Confirm" message="Are you sure?" rendered="#{bean.boolean}"/&gt;
  &lt;/p:commandButton&gt;
  </code></pre>
  
  <p>But rendered doesn't work there (I wish).</p>
  
  <p>Also, I don't want to duplicate the <code>p:commandButton</code> and use its rendered attribute to achieve this.</p>
  
  <p>Is there any way to get this done without changing too many things? I have to do it in a lot of buttons.</p>