- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2014 02:32 AM
Hi All,
Below is the UI macro (approval_summarizer_sc_req_item) we are using.This one is modified not OOTB code.
In this ui macro how to hide empty variables>please provide any information
<?xml version="1.0" encoding="utf-8"?>
<j:jelly trim="true" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<tr>
<td class="label_left" width="100%">
<label style="margin-left: 10px"> Summary of Task being approved:
<g:label_spacing/> </label>
</td>
</tr>
<g:evaluate var="jvar_ni" expression="
var task = ${ref}.sysapproval;
"/>
<tr>
<td>
<table width="100%">
<tr>
<td class="label_left" width="150px">
<label style="margin-left: 10px">Short Description: </label>
</td>
<td> ${task.short_description}
<g:label_spacing/> </td>
</tr>
<tr>
<td class="label_left" width="150px">
<label style="margin-left: 10px">Requested By</label>
</td>
<td> ${task.request.opened_by.getDisplayValue()}
<g:label_spacing/> </td>
</tr>
<tr>
<td class="label_left" width="150px">
<label style="margin-left: 10px">Requested For</label>
</td>
<td> ${task.request.requested_for.getDisplayValue()}
<g:label_spacing/> </td>
</tr>
<tr>
<td class="label_left" width="150px">
<label style="margin-left: 10px">Description:</label>
</td>
<td class="tdwrap"> ${task.description} </td>
</tr>
<tr>
<j:set var="jvar_old_ref" value="${ref}"/>
<g:evaluate>var sc_task = new GlideRecord('sc_req_item'); sc_task.get(task);</g:evaluate>
<j:set var="ref" value="sc_task" />
<j:set var="jvar_questionset_read_only" value="true" />
<td colspan="2"> <g:render_component componentName="com.glideapp.servicecatalog.variables.VEditor" /></td>
<j:set var="ref" value="${jvar_old_ref}" />
</tr>
</table>
</td>
</tr>
</j:jelly>
Solved! Go to Solution.
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2015 08:10 AM
For this we have to modify below UI macro
approval_variable_summary
<?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:evaluate>
var set = new GlideappVariablePoolQuestionSet();
set.setRequestID('${jvar_sc_req_item}');
set.setTaskID('${jvar_sc_task}');
set.load();
</g:evaluate>
<table cellspacing="10" cellpadding="0" width="100%" style="background-color: #fffff0;">
<j:forEach var="jvar_question" items="${set.getFlatQuestions()}">
<!-- Hiding empty variables by Sana -->
<j:if test="${jvar_question.isVisibleSummary()&&jvar_question.getDisplayValue() != ''}">
<g:summarize_question question="${jvar_question}" />
</j:if>
</j:forEach>
</table>
</j:jelly>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2015 10:49 AM
This is good! How do you address for the variables that result in "False" or "None"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2015 06:58 AM
If the field value is None means it is empty and it will not be displayed but if the value is false means it displays the field on the form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2015 08:08 AM
If it is a drop down, it will default to"-none-"
if it is a check-box, it will default to "false"
How can we manipulate the code, so it will only show variables on the approval summary page, that are relevant to the options selected
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2015 10:46 PM
If you don't want to show the fields which are having value false then try like this
&&jvar_question.getDisplayValue() != 'fasle'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2015 09:04 AM
But that wont always be the case, I do want the field to be present, if it is related the option (show/hide UI Policy) being selected.