Confirm Dialog

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

Source

<h:form>

    <p:growl id="messages" showDetail="true" />

    <p:commandButton value="Destroy the World" actionListener="#{buttonBean.destroyWorld}" update="messages">
        <p:confirm header="Confirmation" message="Are you sure?" icon="ui-icon-alert" />
    </p:commandButton>

    <p:confirmDialog global="true" showEffect="fade" hideEffect="explode">
        <p:commandButton value="Yes" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check"/>
        <p:commandButton value="No" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close"/> 	
    </p:confirmDialog>

</h:form>