UI Page Iframe Help

tejumes
Kilo Guru

I have a iframe in the UI Page to bring the Incident list. How can i hide the nav header and breadcrumb in my iframe target list?

1 ACCEPTED SOLUTION

Teju,



    I believe it should be jvar_ci_name instead of ci_name. Other than that everything looks good.



Thanks,


Abhinay



PS: Hit like, Helpful or Correct depending on the impact of the response


View solution in original post

13 REPLIES 13

Thanks Abhu...I tried the above somewhere it is getting missed. So i used &sysparam_fixed_query in the iframe which leads to be to restrict the filters. One thing is it possible to restrict some columns in the list?


I want to remove the certain columns in the retrieved list it is possible?


Hi Abhinay,



I need your help on this pls. I made the UI page to display all the information as stated before BUT i need to display the cmdb_ci_name into the   CI Name field but iam unable to do since it resides in cmdb_ci table. In my message i have "message2" which retrieves the cmdv_ci_name but cannot pass it into the 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">


<html>


<head>


  <g:include_script src="jquery_1_12_3.jsdbx"/>


  <g:include_script src="jquery_dataTables_min.jsdbx"/>


<link rel="stylesheet" type="text/css" href="4a9d42b34f00220099ad34a18110c7e8.cssdbx" ></link>


  <script>


  $(document).ready(function() {


  $('#dataGrid').DataTable();



      });


  </script>


  <center><h2 style="color:black;">CMDB BaseLine Snapshot</h2></center>


 


</head>



  <hr></hr>




<body>




  <div id="section">


  <div id="nav">


  <td>




  </td>




  <center>


  <br></br>



<div class="label_left" style="width:200px">


Select your Baseline:


  </div>


        <g:evaluate>


  var bGr = new GlideRecord('cmdb_baseline');


  bGr.addQuery('active', true);


                        bGr.query();  


                  </g:evaluate>




  <select   name="baseline_name1" id="baseline_name" onchange="changeIncident()" value="${sys_basline_name}" >


  <option value="${bGr.name}">--None--</option>


<j:while test="${bGr.next()}">


      <option value="${bGr.name}">${bGr.name}</option>


</j:while>


</select>


  </center>



  <g:evaluate jelly="true">                    


                   


<!-- var queryString = "sa_tablenameLIKEcmdb_ci^sa_sys_created_on>"+RP.getParameterValue('appName1');   -->


  var queryString = "tablenameLIKEcmdb_ci^sys_created_on>"+RP.getParameterValue('appName1');


    var sysGr = new GlideRecord('sys_audit');


<!-- var sysGr = new GlideRecord('u_baseline_cmdb');   -->


      sysGr.addEncodedQuery(queryString);


      sysGr.query();


  sysGr;


</g:evaluate>



  <hr></hr>


  </div>


  </div>




  <table id="dataGrid" class="display" cellspacing="0" width="100%">


              <thead>


                      <tr>


                              <th rowspan="2">CI Name</th>


                              <th colspan="2">Baseline Information</th>


                              <th colspan="3">Changes</th>


                      </tr>


                      <tr>


                              <th>Table Name</th>


                              <th>Field Name</th>


                              <th>Old Value</th>


                              <th>New Value</th>


                              <th>Reason</th>


                      </tr>


              </thead>


              <tfoot>


                      <tr>


                              <th>CI Name</th>


                              <th>Table Name</th>


                              <th>Field Name</th>


                              <th>Old Value</th>


                              <th>New Value</th>


                              <th>Reason</th>


                      </tr>


              </tfoot>


  <tbody>


      <j:while test="${sysGr.next()}">




<g:evaluate var="sysparm_id">


          var sysparm_id = RP.getParameterValue("baseline_name");


                    sysparm_id;


</g:evaluate>


                      <tr>


                              <td>${sysGr.documentkey}</td>


                              <td>${sysGr.tablename}</td>


                              <td>${sysGr.fieldname}</td>


                              <td>${sysGr.oldvalue}</td>


                              <td>${sysGr.newvalue}</td>


                              <td>${sysGr.reason}</td>


                      </tr>



      </j:while>



  </tbody>


      </table>



</body>


<!-- </body> -->


</html>


</j:jelly>



Client Script:



function changeIncident()


{


          var selValue = gel("baseline_name").value;


    alert(selValue);



          // Make a call to server side script-include using Glide Ajax


  var ga = new GlideAjax('getBaselineDataIndex');


  ga.addParam('sysparm_name','updateBaseLineIndex');


  ga.addParam('sysparm_baseL',selValue);


  ga.getXML(ResponseParse);




function ResponseParse(response){


  var result = ga.requestObject.responseXML.getElementsByTagName("result");


  var result1 = ga.requestObject.responseXML.getElementsByTagName("result1");


      var message = result[0].getAttribute("answer");


  var message2 = result1[0].getAttribute("answer1");


  alert("message"+message);


  alert("message2"+message2);


  window.location.href="baselineTest-edited-direct.do?appName1="+message;


}


}



and also i can't set the baseline_name after loading the page it resets back to none.


Teju,



<tr>


                              <td>${sysGr.documentkey}</td> -- Here you want to display CI name right?


                              <td>${sysGr.tablename}</td>


                              <td>${sysGr.fieldname}</td>


                              <td>${sysGr.oldvalue}</td>


                              <td>${sysGr.newvalue}</td>


                              <td>${sysGr.reason}</td>


                      </tr>



Thanks,


Abhinay



PS: Hit like, Helpful or Correct depending on the impact of the response


Yes Abhinay, You are correct I want to display the CI Name as mentioned by you BUT CI Name will be in cmdb_ci or cmdv_baseline_entry for that particular baseline if we query but here we are querying the sys_audit table because we need old value new value and also   reason for that baseline.


Can you help me to bring out the CI Name into that?


Teju,



  Query on cmdb_ci table using the document key and get the name from there.


<tbody>


      <j:while test="${sysGr.next()}">


<g:evaluate var="sysparm_id">


          var sysparm_id = RP.getParameterValue("baseline_name");


                    sysparm_id;


</g:evaluate>


                      <tr>


<g:evaluate var="ci_name">


var conf= new GlideRecord('cmdb_ci');


conf.get(${sysGr.documentkey});


conf.name;


</g:evaluate>


                              <td>${ci_name}</td>


                              <td>${sysGr.tablename}</td>


                              <td>${sysGr.fieldname}</td>


                              <td>${sysGr.oldvalue}</td>


                              <td>${sysGr.newvalue}</td>


                              <td>${sysGr.reason}</td>


                      </tr>



      </j:while>



Thanks,


Abhinay



PS: Hit like, Helpful or Correct depending on the impact of the response