Friday, January 22, 2016

Open ADF Popup on The Top of The Screen

In ADF if you open a popup, by default this popup will open in the center of the screen. Some customers want to open the popup in the top of the screen, in this case you can choose one component in the top and use align id hints before opening the popup but I see this way is not good because you may not find a suitable component for alignment.

In this post I will show you how to use javascript function to put the popup in the top of the screen. In java function we will get the screen height and we will set the popup dialog margin by screen height divided by 2.

Just call this function before opening the popup (may be in the popup fetch listener)



Send the dialog id to this function and the dialog will be in the top of the screen.

If dialog id ="id1" and you use page template with id ="pt1" so you should send "pt1:d1" to the function.