Show list in modal from UI Page (for selection)

Justin Lee2
Tera Guru

I am developing a UI Page.  The requirement is to add a button that allows the user to select a particular record from a table (in a popup).  

Is there a solution for this that would show ServiceNow's list control in a modal, or do I have to create an additional page for the selection, and show that in a modal?  It would be nice to not have to build a new page and implement the sorting/filtering/etc that is already present in SN's list page.

Note:  The button is on a UI Page, not a form.

 

9 REPLIES 9

Naveen20
ServiceNow Employee
ServiceNow Employee

You can use GlideModal in your ui action on that page which can open a list page given the target_table (sysparm_table_name) and other preferences.

 

Hi Naveen,

1. How do you add a UI Action to a UI Page?  (or was that a typo?)

2. I have set it up to show the list in a GlideModal in the javascript of the UI page - it does show the list in a modal, HOWEVER many javascript errors are thrown, and basically all functionality of the list control is broke because of the errors (sorting, paging, etc) T he javascript errors are:

"GlideList2 is not defined"

"GlideList2NewHandler is not defined"

"GlideWidgetFilter" is not defined"

"GlideWidgetVCR" is not defined"

"GlideWidgetHideOnEmpty is not defined"

Is there an additional javacript file I need to include in the UI Page to show a list in a modal?

Thanks!

Justin Lee2
Tera Guru

Hi Naveen,

1. How do you add a UI Action to a UI Page?  (or was that a typo?)

2. I have set it up to show the list in a GlideModal in the javascript of the UI page - it does show the list in a modal, HOWEVER many javascript errors are thrown, and basically all functionality of the list control is broke because of the errors (sorting, paging, etc) T he javascript errors are:

"GlideList2 is not defined"

"GlideList2NewHandler is not defined"

"GlideWidgetFilter" is not defined"

"GlideWidgetVCR" is not defined"

"GlideWidgetHideOnEmpty is not defined"

Is there an additional javacript file I need to include in the UI Page to show a list in a modal?

Thanks!

Naveen20
ServiceNow Employee
ServiceNow Employee

I just referred to the ui action in general

Are you using UI16 and which release are you on.

Can you check the below ui script -> line 341 to 362 ($scope.openCI = function(element, $event))

This is in major incident workbench. Affected CI's Add button.

nav_to.do?uri=%2Fsys_ui_script.do%3Fsys_id%3D70cc15a35f380300f51ca184ff4666a3%26sysparm_record_rows%3D1%26sysparm_record_scope%3D2efa4be5db0003004d27b31be0b8f5e9%26sysparm_record_target%3Dsys_ui_script%26sysparm_record_list%3DnameSTARTSWITHsn_major_inc_mgmt.workbench%5EORDERBYDESCsys_updated_on%26sysparm_nostack%3Dtrue%26sysparm_record_row%3D1