- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2023 01:33 AM
I am using UI script to display UI pages.
“var gDialog = new GlideModal(ui_page_name, 200, 300);
gDialog.setTitle(ui_page_title);
gDialog.render();”
I executed "GlideDialogWindow.get().destroy();" in the UI script process, but the dialog did not disappear.
Do you know the cause?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2023 05:23 PM - edited 10-05-2023 08:23 AM
gDialog.destroy();'' didn't work because the gDialog variable doesn't seem to be accessed.
As a solution, I created a function called "GlideDialogWindow.get().destroy();".
When I created it on a UI page and called it from a UI script, it disappeared as expected. .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2023 10:07 AM
Try with GlideDialogWindow.destroy()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2023 04:43 PM
It didn't move. .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2023 11:58 PM
HI @bonsai ,
I trust youa re doing great.
The code you provided is for displaying a UI page using the GlideModal object. The method you used to attempt to close the dialog, GlideDialogWindow.get().destroy();, is typically used for dialogs created using the GlideDialogWindow object, not the GlideModal object.
To close a dialog created with GlideModal, you should use the destroy() method on the GlideModal object itself.
Here's how you can do it:
- First, ensure that the gDialog variable is accessible in the scope where you're trying to close the dialog.
- Then, simply call the destroy() method on the gDialog object.
gDialog.destroy();
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2023 05:23 PM - edited 10-05-2023 08:23 AM
gDialog.destroy();'' didn't work because the gDialog variable doesn't seem to be accessed.
As a solution, I created a function called "GlideDialogWindow.get().destroy();".
When I created it on a UI page and called it from a UI script, it disappeared as expected. .