The CreatorCon Call for Content is officially open! Get started here.

GlideDialogWindow.get().destroy() is not working in UI Page

Madankumar N1
Tera Contributor

Hi Team

am not able destroy ui page in my requirement am using this function to destroy ui page"GlideDialogWindow.get().destroy();" but is working remaining places in my function only it is not working;

am using UI page1 in UI Action
in UI page1 i have button called validated it will open another page UI Page2.

UI Page2 i have two buttons Yes or No

if i click no it has close UI Page2 and it has to open another UI Page3

It is opening UI Page3 but UI Page2 is not closing

 

 

 

 

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Madan,

Can you share your code?

Regards

Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

UI Page Code:

<input type='hidden' name='change_number' id='change_number' value="${changeNumber}"/>
<p><b>Do you want to background processing?</b></p>
<br/>
<table>
<tr>
<td colspan="2" style="padding-top:20px;">
<button class="btn btn-primary" onclick="backgroundProcessing()" style="width:80px;">Yes</button>
<button class="btn btn-default" onclick="uiProcessing()" style="width:80px;margin-left:20px;">No</button>
</td>
</tr>
</table>

 

UI Page Client script :

function uiProcessing(){

GlideDialogWindow.get().destroy();
var change_request=gel('change_number').value;

var loadingDialog = new GlideDialogWindow("dialog_loading", true);
loadingDialog.setPreference('table', 'loading');
loadingDialog.setTitle('Loading...'); //Set the loading dialog title here...
loadingDialog.render();

}

Hi Madan,

Did you try adding an alert whether the function is getting called or not?

Regards

Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Yes

alert is coming another ui Page3 is also opening but my current ui page is not destroying which i have buttons