Dialog - Close

Close event can be listened via ajax behavior.

Show the Picture of the Day
Picture of the Day

Source

<h:form>

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

    <h:outputLink id="openDialogLink" value="javascript:void(0)" onclick="dlg.show()">Show the Picture of the Day</h:outputLink>

    <p:dialog id="picture" widgetVar="dlg" header="Picture of the Day" width="425"
        resizable="false" showEffect="clip" hideEffect="clip">

        <p:ajax event="close" update="growl" listener="#{dialogBean.handleClose}"/>

        <p:graphicImage value="/images/nature3.jpg" />

    </p:dialog>

</h:form>