- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2016 02:18 AM
Is it possible to bring up the list view in UI page.
eg: we have a baseline module , after creating a new baseline we can see the list of entries for a specific condition as shown below is it possisble to bring up these list (CMDB Baseline Entries) into an UI page ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2016 08:56 PM
Hi Malu,
You need change the code of iframe like below code getting Incident list based on Caller
<g:ui_reference name="requester_id" query="active=true" table="sys_user" id="requester_id" value="${gs.getUserID()}" displayvalue="${gs.getUser().getName()}"/>
<button class="button" style="margin-left:5px" id="getList" onclick="getIncList();">Get User Incidents</button>
<div id="targetList">
<iframe src="incident_list.do?sysparm_query=caller_id=javascript:gs.getUserID()" style="min-height:400px;width:100%;" scrolling="no" frameborder="0"></iframe>
</div>
<script>
function getIncList(){
var caller = document.getElementById('requester_id').value ;
var newIframe = '<iframe src="incident_list.do?sysparm_query=caller_id='+caller+'" style="min-height:400px;width:100%;" scrolling="no" frameborder="0"></iframe>' ;
document.getElementById('targetList').innerHTML =newIframe ;
}
</script>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2016 09:49 PM
My Bad i corrected issue resolved by changing below. Awesome solution:)
script>
function getBaseEntList(){
var caller = document.getElementById('baseline_name').value ;
var newIframe = '<iframe src="cmdb_baseline_entry_list.do?sysparm_query=baseline='+caller+'" style="min-height:400px;width:100%;" scrolling="no" frameborder="0"></iframe>' ;
document.getElementById('targetList').innerHTML =newIframe ;
}
</script>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2016 03:59 AM
Hi Malu,
The short answer is, you'll have to do it yourself. You need to build your own UI macro to create the list. Here's an example of one I did. It took a few parameters like the header and array of objects to process.
Excerpt, from the UI page:
<g2:evaluate>
var sList = new ExamUtil().getScoreList();
var header = [{"text":gs.getMessage('exam_name'),"style":""},
{"text":gs.getMessage('exam_state'),"style":""},
{"text":gs.getMessage('exam_attempt'),"style":""},
{"text":gs.getMessage('exam_pass_fail'),"style":""},
{"text":gs.getMessage('exam_percent'),"style":"width:200px"}
];
gs.debug('back from score list. length='+sList.length);
</g2:evaluate>
<g2:macro_invoke macro="sn_exam_table" header="$[header]" list="$[sList]" />
------------------
The UI Macro just constructed the table using while loops on the objects. Here's the first few lines.
<?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 expression="gs.debug('10');" />
<table cellspacing="2">
<tr class="header">
<j:forEach var="jvar_hdr" items="${jvar_header}">
<g:evaluate expression="gs.debug('20');" />
<j:set var="jvar_hdr_text" value="${jvar_hdr.get('text',jvar_item)}" />
<j:set var="jvar_hdr_style" value="${jvar_hdr.get('style',jvar_item)}" />
<td style="${jvar_hdr_style}" class="vt" title="">${jvar_hdr_text}</td>
</j:forEach>
</tr>
<g:evaluate expression="gs.debug('30');" />
<j:set var="jvar_row_count" value="1"/>
<j:forEach var="jvar_item" items="${jvar_list}">
--------------------
Note: I am still working on getting this part to work in a scoped app on Helsinki. It worked great as a global app in earlier releases.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2016 05:31 AM
Thanks ctomasi. I'm a newbie to this UI , It become a big task for me.
I will try with this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2016 05:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2016 09:51 PM
Hi Malu,
Its a reference field and in sysparm_query, filter should be on basis of sys_id
sysparm_query=sys_id='+caller+'....
