Need to Close GlideDialogWindow which uses iFrames

vikasbulchandan
Tera Contributor

Hi All,

I have a popup opened using GlideDialogWindow which opens an UI Page which uses iframe and its source is another UI Page. I am trying to close the pop through client script of referred UI Page, but its not working. Here's the code snippet.

Parent UI Page:

<?xml version="1.0" encoding="utf-8" ?>

<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">

<j:set var="jvar_chgSysId" value="${RP.getWindowProperties().get('chgSysId')}" />

<div class="xm-dialog-form">  

  <div class="embed-responsive xm-embed-iframe" style="height:700px; width:1000px">

  <iframe name="dialog_frame" id="dialog_frame" src="/ui_page_referred.do?sysparm_nostack=true&amp;jvar_chgSysId=${jvar_chgSysId}" class="embed-responsive-item"></iframe>  

  </div>  

</div>

</j:jelly>

Client Script of Referred UI Page:

GlideDialogWindow.get(window.parent).destroy();

//window.parent.close();

Both of above statements are not working. Can you please help me.

1 ACCEPTED SOLUTION

If you're running this from within the iframe I would take a look at using parent or top to get back to the page hosting the iframe and close the GDW from there.


View solution in original post

6 REPLIES 6

ananthagowraram
Mega Expert

Hi Vikas,



Can you explain briefly what is the requirement?Do you want to close window based on some conditions?



Regards


Anantha Gowraram


Hi Anantha,



No Specific condition. On click of a button, I am performing some updates using GlideRecord and then I need to close/destroy the popup.



One more thing to mention - I have written this inside a UI Script.



Thanks,


VIkas.


If you're running this from within the iframe I would take a look at using parent or top to get back to the page hosting the iframe and close the GDW from there.


Hi Brad,



I tried window.parent.GlideDialogWindow.get().destroy , but it didn't worked. Seems to be I am doing it incorrectly.