Pages

Wednesday, September 7, 2016

How to execute code after a popup is launched

In one of my project, I had a requirement to execute some code after a popup is launched. After struggling for some time, I found a way to implement it. In this post, I will describe you one of the popup client events which can be used to execute a code after a popup is made visible.

Out of many client events that a popup supports, there is an event called popupOpened which is fired once a  popup becomes visible. You can use this event for handling custom code that should be executed once the popup is launched.

Use the below code to implement such behavior.

<af:popup id="p1">
    <af:dialog type="none" closeIconVisible="true"
               resize="off" id="d3">
        <af:panelGroupLayout id="pgl12" layout="vertical">
            ......
            ......
        </af:panelGroupLayout>
    </af:dialog>
    <af:clientListener method="<custom method>" type="popupOpened"/>
</af:popup>

Here <custom method> is the custom method name that needs to be executed.

No comments:

Post a Comment