Question
Synechron Inc.
US
Last activity: 23 Aug 2017 8:27 EDT
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:
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.