Filter ui_reference in a UI Page

Michael Kaufman
Giga Guru

I have an Assignment Group and Assigned to fields on an UI Page. I want to filter the Assigned To list by "active=true^roles=itil" and the Assignment Group.

I don't know how to do this, and there isn't much documentation. Any ideas?

I tried adding "'QUERY:active=true^roles=itil" to the name, but that messes up the processing script. Also I can't figure out how to filter the users by the groups selected in this UI Page.

Here is my html:



<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<form action="ui_page_process.do">
   <input type="hidden" name="name" value="hp_planned_task_creator"/>
   <input type="hidden" id="cancelled" name="cancelled" value="false"/>
   <g:evaluate>
         var parent_task = '${sysparm_sysID}';
   </g:evaluate>
     <table>
           <tr>
                 <td nowrap="true">
                       <label>Assignment Group:</label>
                 </td>
                 <td>
                       <g:ui_reference name="assignment_group" id="assignment_group" table="sys_user_group" value="${sysparm_group_value}" displayvalue="${sysparm_group_displayvalue}"/>
                 </td>
           </tr>

           <tr>
                 <td nowrap="true">
                       <label>Assigned to:</label>
                 </td>
                 <td>
                       <g:ui_reference name="assigned_to"   id="assigned_to" table="sys_user"/>
                 </td>
           </tr>
           <tr>
                 <td nowrap="true">
                       <label>Time Card Active:</label>
                 </td>
                 <td>
                       <g:ui_checkbox name="timecard_active" value="${sysparm_timecard_active}"/>
                 </td>
           </tr>
           <tr>
                 <td nowrap="true">
                       ${gs.getMessage('Quantity')}:
                 </td>
                 <td>
                       <input name="task_quantity" id="task_quantity" value="1"/>
                 </td>
           </tr>
           <tr>
                 <td align="right"   colspan="2">
                       <g:dialog_buttons_ok_cancel ok="return true;" cancel="return onCancel();" />
                 </td>
           </tr>
     </table>
     <input type="hidden" name="parent_task" id="parent_task" value="${sysparm_sysID}"/>
</form>
</j:jelly>


1 ACCEPTED SOLUTION

Michael Kaufman
Giga Guru

I figured out how to filter the ui_reference field.



<g:ui_reference name="QUERY:active=true^roles=itil" id="assigned_to" table="sys_user" />


Then in the Processing Script, you reference that name field like this:



newTask.assigned_to = request.getParameter("QUERY:active=true^roles=itil");


Now I want to make this ui_reference field dependent on another ui_reference. For instance, I have an Assignment field and an Assigned To field. I want the assigned to dependent what the Assignment field is selected?

Is there a parameter with a ui_reference to make it dependent on another field?


View solution in original post

10 REPLIES 10

Hi nice script but could you please give information as to whats meant to be in the script include. I can't seem to understand how to use your script.