Confirm Dialog

ConfirmDialog is integrated with confirm behavior and used as a replacement for the javascript confirmation utility.

<h:form>     
    <p:growl id="message" showDetail="true" />
    
    <p:commandButton value="Destroy the World" action="#{dialogView.destroyWorld}" update="message">
        <p:confirm header="Confirmation" message="Are you sure?" icon="pi pi-exclamation-triangle" />
    </p:commandButton>
    
    <p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
        <p:commandButton value="Yes" type="button" styleClass="ui-confirmdialog-yes" icon="pi pi-check" />
        <p:commandButton value="No" type="button" styleClass="ui-confirmdialog-no" icon="pi pi-times" />
    </p:confirmDialog>      
</h:form>