Based on Frank’s (Frank Nimphius) article How to auto-dismiss af:popup dialogs and the sample 105, a user on OTN JDev & ADF forum tried to get this running on JDeveloper 220.127.116.11.0. Franks sample was built using JDeveloper 18.104.22.168.0 and can’t be run without changes in JDeveloper 22.214.171.124.0.
However, it’s easily possible to build a sample using 126.96.36.199.0 showing how to use the af:poll to close a popup using an af:noteWindow or an af:dialog inside the popup. The technique is described in Frank’s article, so I spare repeating it here.
Let’s look at the running application
Clicking on the link “Show Popup NW” or the button “Popup NW” shows the location of the department in a note window
Clicking on the link “Show Popup DW” or the button “Popup DW” shows the location of the department in a dialog window (modal)
You can download the sample, which is using the HR DB schema, from ADF EMG Samples Project
as it turned out there is a problem with the af:poll component and the timeout setting. This timeout setting should cancel the poll component after the given period of time (which should work in 188.8.131.52). This was one key feature in Frank’s original article. Using 184.108.40.206.0 it turned out, that hte af:poll remains active even after the timeout period should have canceled any further events to the poll listener.
I implemented a fix for this behavior. The popup uses a fetch listener which sets the interval (5000 ms in the sample) and the poll listener cancel the poll by setting the interval to -1 after hiding the popup.
The code is written in a generic way to allow handling of different popups. Please download the new sample from ADF EMG Samples Project