- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2019 05:19 AM
Hi there,
I am trying to get the values from a List Collector that I have coded on a UI Page so that I can set these values into a List Collector variable that I have created on the Change Request form. However, whenever I try to get the value of the documentElement of the List Collector from the UI Page, then the value returned is a value of 'null'. The code snippets are below. Wondering if anyone can help me with this, or give me any pointers.
Thanks in advance!
UI Page
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:ui_form>
<!-- Get values from dialog preferences passed in -->
<g:evaluate var="jvar_short_text"
expression="RP.getWindowProperties().get('short_text')" />
<g:evaluate var="jvar_comments_text"
expression="RP.getWindowProperties().get('comments_text')" />
<!-- Set up form fields and labels -->
<table width="100%">
<tr id="description_row" valign="top">
<td colspan="1">
<!-- Short description value used as a label -->
${jvar_short_text}
</td>
</tr>
<tr>
<td>
<!-- Comments text field (Contains comments from originating record as a default) -->
<g:macro_invoke macro= "lightweight_glide_list" id="userList" name="userList" control_name="listCollector" reference="sys_user" can_write="true" />
</td>
</tr>
<tr>
<td colspan="2">
</td>
</tr>
<tr id="dialog_buttons">
<td colspan="2" align="right">
<!-- Pull in 'dialog_buttons_ok_cancel' UI Macro for submit/cancel buttons.'ok' option will call the 'validateComments' Client script function from the UI Page-->
<g:dialog_buttons_ok_cancel ok="return validateSelection()" ok_type="button" cancel_type="button" />
</td>
</tr>
</table>
</g:ui_form>
</j:jelly>
Client Script
function validateSelection() {
try {
//Gets called if the 'OK' dialog button is clicked
//Make sure dialog comments are not empty
var users = gel("userList").value;
//If comments are not empty do this...
GlideDialogWindow.get().destroy(); //Close the dialog window
g_form.setValue('u_additional_approvers_defined', true); // Set the 'Additional Approvers Defined' boolean flag to true
g_form.setValue("u_additional_approvers", users); //Set the users selected in the list collector to the list on the Change Request.
} catch (err) {
g_form.addErrorMessage(err);
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2019 05:34 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2019 06:00 AM
Hi Ethan,
for slushbuckets, you'll need to take values as left/right. So if selected something from slush from left to right to get it you need to use similar approach :
var my slushRightValue = slush.getValues(slush.getRightSelect());
Cheers,
Joro