Jelly and RP.getWindowsProperties

poyntzj
Kilo Sage

I am struggling to get a table name through to a ui page

The UI action has

dialog.setPreference("table_name", g_form.getTableName());

the ui page has

<g:ui_table>

  <g:set var="jvar_tablename" value="$[RP.getWindowProperties().get('table_name')]"/>

and a bit later on

gr.addQuery('table',jvar_tablename);

but it is not seemingly being passed the value

I have plenty of other ui pages that are working so I am a little bemused

for example, this is from one that works

UI action

dialog.setPreference("sysid", sysid);

UI Page

<g:ui_form>

<!-- Holds the Incident ID for use in HTML and the processing script -->

<j2:set var="jvar_incident_id" value="$[RP.getWindowProperties().get('sysid')]"/>

Only difference that I see is that the non working one is using a ui_table and the one that works is using ui_form, but I cannot see this making that much of a difference.

Any ideas would be appreciated

Cheers

1 ACCEPTED SOLUTION

This worked for me in the end



<g:evaluate jelly="true">


  var table_name = RP.getParameterValue('sysparm_table_name') + '';


  var strQuery = "table="+table_name+"^active=true"


  var templates = new GlideRecord('sys_template');


  templates.addEncodedQuery(strQuery);


  templates.orderBy('name');



Cheers


View solution in original post

21 REPLIES 21

Ahh 😃 thought I might have missed something that it could be used for


As Brian says that is a hangover from when you guys were helping me with the initial version.


Now the code does what I want I need to tidy up the UI Page as somethings are out of alignment



Cheers