Home > database >  Dialog close Dynamic action not being fired
Dialog close Dynamic action not being fired

Time:11-11

I'm opening a normal page as a dialog using javascript:apex.navigation.dialog('f?p=&APP_ID.(...),{title:'Page',height:'900',width:'1800',maxWidth:'1600',modal:true,dialog:null},'t-Dialog--standard'); through the "Redirect to URL" action of a button. In addition, I've a dynamic action (Dialog closed) associated to that button.

On the page that's opened, I've a button with a DA that has a javascript action with apex.navigation.dialog.close(true);.

I was expecting the dialog closed DA would fire as I closed the 'dialog' page, when I clicked the button referenced above. What am I missing?

CodePudding user response:

There is no close event registered if you open the dialog this way. You can achieve this by firing a custom event on close of the dialog. This is clearly explained in Max' blog here. However, you state "I'm opening a normal page" which means you can't configure that solution as described.

You're trying to mix 2 things: some dialog functionality (a dynamic action on close) and redirect (which is completely different than a dialog and does not have the properties a dialog has). In a redirect, there is no relation anymore between the calling page and the opened page so you'll have to come up with your own custom solution.

CodePudding user response:

I was able to find a workaround for this issue by creating a modal page with a "Dynamic Content" region. In it I coded an iFrame: htp.p('<iframe id ="test" scrolling="no" src="#URL_OF_THE_NORMAL_PAGE" style="padding-top:5px;border:0px;width:1900px;height:1100px;"></iframe>');

In the modal page I cretated a button with the action "Close Dialog" on click. This way, the normal page would be presented in a modal page look and the DA "Dialog close" on the parent page would fire when I clicked the button.

To make the normal page look more like a dialog, I've used some css to hide the menus under certain conditions (if the page was being open through the iframe).

  • Related