UI Page query using array

DoDo labs___
Mega Sage

 

I would like to pass change requests in an array to a UI Page using UI Action and display only those changes.
The current HTML script displays all changes.
How should i modify the HTML script to achieve this?
 
 
UI Action script:
 
function openChangeRequestList_NoParent(){
 
    var lista = [];
 
    var gr = new GlideRecord('problem');
    gr.addQuery('sys_id', g_form.getUniqueValue());
    gr.query();
    if (gr.next())
        {
            lista = gr.u_change_list.split(",");
        }
 
    var dialog = new GlideDialogWindow('FIG_problem_remove_change'); 
    dialog.setTitle('Remove Change Request');
    dialog.setSize(650, 600);
    g_scratchpad.info = g_form.getUniqueValue();
    dialog.setPreference('sysparm_number', lista);
    dialog.render();
 
}
 
UI Page HTML script:
 
<?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>
<table>
<tr>
                  <td style="width:25%">
<g:form_label>
Select Change Request: 
        </g:form_label>
                  </td>
  <td style="width:60%">
    <g:ui_reference name="number" id="number" query="user_nameSTARTSWITHa" table="change_request"  />
                   </td>
                </tr>
<tr>
                     <td>
                       <g:dialog_buttons_ok_cancel ok_id="submitData" ok="return continueOK()" ok_type="button" ok_text="${gs.getMessage('Submit')}" ok_style_class="btn btn-primary" cancel_type="button" cancel_id="cancelData" cancel_style_class="btn btn-default" cancel="return continueCancel()"/>
                    </td>
               </tr>
</table>
</g:ui_form>
</j:jelly>
 
1 ACCEPTED SOLUTION


I have found a solution: I converted the array to a string, and with the numbers of the changes, I also passed the following text to the ui page:
^NQnumberSTARTSWITH

This is how I passed it to the UI page:


<j:set var="jvar_numbers" value="${RP.getWindowProperties().get('Change_Requests')}">
</j:set>
<g:ui_reference name="number" id="number" query="${jvar_numbers}" table="change_request" />

View solution in original post

5 REPLIES 5


I have found a solution: I converted the array to a string, and with the numbers of the changes, I also passed the following text to the ui page:
^NQnumberSTARTSWITH

This is how I passed it to the UI page:


<j:set var="jvar_numbers" value="${RP.getWindowProperties().get('Change_Requests')}">
</j:set>
<g:ui_reference name="number" id="number" query="${jvar_numbers}" table="change_request" />