Question

9
Replies
2543
Views
Abhijit_Saha Member since 2011 8 posts
Cognizant Technology Solution
Posted: 3 years ago
Last activity: 3 years 1 month ago
Closed
Solved

How to View External Application in IFRAME Through HTTP POST in Pega

In our Application we have to show an External Application through HTTP POST and it would be in IFRAME. Is there a way to achieve this?

For POC Puspose, we used this below code. It doesn't bring anything in Pega; but in Stand Alone execution (save the code into .html file and open it in Browser) it populates result.

Code:

<html xmlns="http://www.w3.org/1999/xhtml">
  <head/>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type='application/javascript'>
  
   function loadGraph() {
     
      
      var frm = document.getElementById("post_form");
     
      if (frm) {
        
       frm.submit();
       
        //document.forms[0].submit();
      }


    }
  </script>
 <body >
<form  action='https://chart.googleapis.com/chart' method='POST' id='post_form' target="output_frame">
      <input type='hidden' name='cht' value='lc'/>
      <input type='hidden' name='chtt' value='This is | my chart'/>
      <input type='hidden' name='chs' value='300x200'/>
      <input type='hidden' name='chxt' value='x'/>
      <input type='hidden' name='chd' value='t:40,20,50,20,100'/>
	
    </form>
   
   <iframe   name="output_frame"  width="500" height="290" onload="loadGraph()">
    </iframe>

</body>
</html>

Stand Alone Execution Result:

Pega Embeded Result:

In the Images Tab, we have used a Section with the HTML Code and onclick of that Tab, Code needs to be executed and the Result will be Populated as Chart.

Any advise please.

User Interface
Moderation Team has archived post
Share this page LinkedIn