Multiple values selection in ui page and accessing all those values in client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2023 08:16 AM
Hi All,
We have a requirement to showcase a configuration item field which is reference to cmdb_ci table in UI Page and users should be able to select multiple assets and accessing those values in client script and push to the script include using glide ajax.
Kindly guide me on this.
Thanks In Advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2023 04:36 PM
Do you have a mockup? What do you have so far?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2023 04:39 AM
Hi,
Please find the below code what I have done so far. I am able to achieve multi-select by invoking OOB mcaro in ui page. But the values are coming as sys-id's while accessing this in client script. I need to pass actual display value to script include from client script of ui page.
HTML CODE:
<div id ="vulnerabilityitem_label" class="form-group " ng-show="!multipleInputs && fieldsVisible > 0" aria-hidden="false"><label>Vulnerability item</label>
<g:macro_invoke macro="lightweight_glide_list2" id="vulitem" control_name="vulitem_list" reference="sn_vul_vulnerable_item" can_write="true" />
</div>
<div id ="configurationitem_label" class="form-group " ng-show="!multipleInputs && fieldsVisible > 0" aria-hidden="false"><label>Configuration item</label>
<g:macro_invoke macro="lightweight_glide_list2" id="configitem" control_name="configitem_list" reference="cmdb_ci" can_write="true"/>
</div>
Client Script:
var configitem = $('configitem_list').value;
var vulnerabilityitem = $("vulitem_list").value;
Kindly help me to get actaul vulnerability iotem numbers and ci names which will be selecting in ui page.
Thanks and Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2023 04:47 AM
Hi,
I have already achieved mutil select in u pgae by invoking oob ui macro. But I need to get the display value of those fields. Please find the below code.
HTML CODE:
<div id ="vulnerabilityitem_label" class="form-group " ng-show="!multipleInputs && fieldsVisible > 0" aria-hidden="false"><label>Vulnerability item</label>
<g:macro_invoke macro="lightweight_glide_list2" id="vulitem" control_name="vulitem_list" reference="sn_vul_vulnerable_item" can_write="true" />
</div>
<div id ="configurationitem_label" class="form-group " ng-show="!multipleInputs && fieldsVisible > 0" aria-hidden="false"><label>Configuration item</label>
<g:macro_invoke macro="lightweight_glide_list2" id="configitem" control_name="configitem_list" reference="cmdb_ci" can_write="true"/>
</div>
Client Script:
var configitem = $('configitem_list').value;
var vulnerabilityitem = $("vulitem_list").value;
This is giving sys id's. But I need to get the actual vulnerable item numbers and ci names selected in the above fields and pass it to script include.
Thanks and Regards