Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

"GlideDialogWindow.get().destroy();" does not work

bonsai
Mega Sage

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?

1 ACCEPTED SOLUTION

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. .

View solution in original post

4 REPLIES 4

Vijayalakshmi P
Kilo Sage

Try with GlideDialogWindow.destroy()

@bonsai 

It didn't move. .

Amit Gujarathi
Giga Sage

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:

  1. First, ensure that the gDialog variable is accessible in the scope where you're trying to close the dialog.
  2. 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



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. .