g_modal.showFrame AutoCloseOn property

obaylac
Tera Contributor

Hello everyone,

 

I'm trying to create a "Add to Visual Task Board" button in workspaces, but I'm a bit puzzled by the lack of g_modal documentation...

 I managed to show the Visual task board selection frame using g_modal.showFrame(), and it's adding the incident to the chose VTB alright, but the g_modal box remains open. (and nothing shows that the "add to VTB" action is done)

 

In one of the few community posts about g_modal, I can see there is a "AutoCloseOn" property, which sounds like it could be what I need, but I haven't been able to find another possible value for it than "URL_CHANGED"...

 

Where the hell did @Ashley Snyder find this property and does anyone know the other possible values ?

 

web development is relatively new to me, so I don't really know if and where I could find the g_modal API source code (I don't even know which class does this object instanciates)

 

Thanks!!

 

Regards,

Olivier

2 REPLIES 2

DrewW
Mega Sage
Mega Sage

This is a standing MO for ServiceNow to leave out documentation for things, but I digress.

 

You best two options at this point is look thru other client scripts for workspace and see if any other values are using and experiment with them.

 

The second option is to log a case and hope support is can/is willing to tell you something.

 

obaylac
Tera Contributor

Thanks for the answer, but sadly I've already ruined the first solution, by navigating in .jsx files from chrome developer panel, I've found there's only two possible values for the AutoCloseOn constant, the other one being "EMPTY_PAGE" (or something like that, I didn't take note of it).


My other Idea would be to find another way to pop a modal, but it seems creating a GlideModal and use render() doesn't work in workspaces (nothing happens)

 

I'm also thinking about learning to use the UI builder, but it will take some time and I'm not even sure it will make what I want to do possible...

 

Isn't there a way to create an onclick Event in client script ?