Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ServiceNow UI Page to display application files
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:g2="null" xmlns:g="glide" xmlns:j2="null" xmlns:j="jelly:core">
<!-- get the scope of the current record and list of tables to display-->
<g:evaluate var="jvar_my_scope">
var scope = new GlideRecord("sys_scope"); scope.get("scope", gs.getCurrentScopeName()); scope;
</g:evaluate>
<g:evaluate expression="scope.getDisplayValue()" var="jvar_my_scope_name"/>
<g:evaluate expression="scope.getUniqueValue()" var="jvar_my_scope_id"/>
<g:evaluate expression="gs.getProperty(scope.scope + '.config_file_tables','')" var="jvar_config_tables"/>
<!-- notify user if we don't have tables property -->
<j:if test="${jvar_config_tables == ''}">
The required property 'config_file_tables' in scope ''${scope.scope}'' is missing
</j:if>
<j:if test="${jvar_config_tables != ''}">
<nav class="navbar navbar-default" role="navigation" style="min-width:935px;">
<div class="container-fluid">
<div class="navbar-header">
<h1 class="navbar-title" style="display:inline-block;">Configuration files for ${jvar_my_scope_name}</h1>
</div>
<div class="nav navbar-right"></div>
</div>
</nav>
<g:inline template="tabs2.xml"/>
<TABLE border="0" cellPadding="0" cellSpacing="0" id="testtable" width="100%">
<TR>
<TD valign="top">
<j:set value="cardboard" var="jvar_list_type"/>
<br/>
<!-- tabstrip for related lists -->
<div class="tabs2_strip" id="tabs2_list">
<!-- hack for IE bug when tab strip causes a horizontal scroll bar to appear -->
<img alt="" height="1px" src="images/s.gifx" style="margin-right: 0px;" width="1px"/>
</div>
<!--
Start with the lists not displayed so that we do not impact the page scroll position - gets shown in
the onLoad event below
-->
<span id="list_span" style="display:none;border-top: 1px solid black; padding-top: 5px; margin-top: -7px;">
<j:set value="true" var="jvar_use_name_for_list_id"/>
<j:forEach items="${jvar_config_tables.split(',')}" var="jvar_config_table">
<!-- make sure we have a valid table -->
<g:evaluate jelly="true" var="jvar_valid_table">
var isValid = false; var tableName = jelly.jvar_config_table.trim(); var configTable = new GlideRecord(tableName); if (configTable.isValid()) isValid = true; isValid;
</g:evaluate>
<j:if test="${jvar_valid_table == true}">
<!-- display the table list of filtered records -->
<g:inline source="${jvar_my_scope_id}" table="${jvar_config_table.trim()}" table_field="sys_scope" template="personalize_all_list.xml"/>
</j:if>
</j:forEach>
</span>
</TD>
</TR>
</TABLE>
<script>
addLoadEvent(function () {
var tabs = new GlideTabs2("tabs2_list", gel("list_span"), 0, '');
tabs.activate();
show("list_span");
});
</script>
</j:if>
</j:jelly>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.