title: How can I show p:confirmDialog from bean?
body: <p>I got this from primefaces but I dont want to use the button and call the confirm dialog from the bean, how can I do this or render commandbutton and execute from bean?</p>
  
  <p>The problem is that Im using a commandbutton to execute a method, this method has an if in it when true then I want to show a confirm dialog.
       </p>
  
  <pre><code>&lt;p:commandButton value="Destroy the World" actionListener="#{dialogView.destroyWorld}" update="message"&gt;
      &lt;p:confirm header="Confirmation" message="Are you sure?" icon="ui-icon-alert" /&gt;
  &lt;/p:commandButton&gt;
  
  &lt;p:confirmDialog global="true" showEffect="fade" hideEffect="fade"&gt;
      &lt;p:commandButton value="Yes" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" /&gt;
      &lt;p:commandButton value="No" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" /&gt;
  &lt;/p:confirmDialog&gt;
  </code></pre>