I am trying to fire off the button click event from fancybox iframe. The apex page has a button that launches a fancybox iframe which is loaded with an APEX form. On close of that fancy box, I am trying to fire a click event on the parent page which will refresh a div with html that is created with plsql. The button on the page works as expected when clicked from the page. It will show a debug alert message to prove it was called and then load the div with the correct data. I am unable to fire off this button click from the fancybox iframe when it closes.
A couple of points:
I using Plug-in: Execute PL/SQL Code and Return Content ("PLUGIN_MULEDEV.SERVER_REGION_REFRESH") to place the create fancybox statement. It is used to populate a div using plsql.
The name of the button on the main page is P2020_REFRESH_SECTION_BUILDER_BTN.
The click dynamic action on the button is calling the plugin to replace the html in the div.
The data in the form in the fancybox is being saved to the database. On close of the fancybox box I want to refresh the div so the new record is included in the div html.
Can anyone help. Here is the fancybox code:
function customProcessOnReadyState4(){
for (var i=0;i<11;i++){
$( "#tabs"+i ).tabs();
$("#createNewExerciseLink"+i).fancybox({
''width'' : ''60%'',
''height'' : ''70%'',
''autoScale'' : true,
''transitionIn'' : 200,
''transitionOut'' : 200,
''type'' : ''iframe'',
''onClosed'' : function() {
window.parent.$(''#P2020_REFRESH_SECTION_BUILDER_BTN'').click();
}
});
}
Here are the dynamic actions assigned to the button:
5 - Execute JavaScript Code
alert("Starting refresh");
10 - Execute PL/SQL Code and Return Content [Plug-in]
begin
SCTUI.create_sct_tabs2(:P2020_CREATE_SECTION_LOV, '1');
end;