Focal Point
Maintain and iframe

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8031012162

December 11, 2007, 09:47 AM
GamP
Maintain and iframe
Hi all,
I finally have a question for you wizards out there.
On a maintain form I have an iframe called PDFrame, which I would like to dynamicly populate with the result of a table request, triggered by a click on a button. This result is a pdf document.
I have been able to create a very simple htm page with a button that I can click to populate the iframe, and that works fine. But I seem to be unable to transport this technique into my maintain.
The htm-form used to test this is:
<html>
<head>
<script id=Onbtn_Show_Click language=JavaScript>
<!--
function Onbtn_Show_Click() {
document.getElementById("PDFrame").src="/ibi_apps/WFServlet?IBIF_ex=show_802&IBIAPP_app=myapp&ITEM=1";
}
// -->
</script>
</head>
<body>
<input class="button" id=btn_Show type=button name=btn_Show value="Show"
 style="position:absolute;top:80;left:50;width:96;height:24;visibility:visible; "
 onclick="Onbtn_Show_Click();">

<iframe id=PDFrame name=PDFrame
 style="position:absolute;top:122;left:12;width:750;height:408;visibility:visible; "
 tabindex=-1 scrolling=auto src="" srcURL="" frameBorder="no">
</iframe>
</body>
</html>
And this works fine.

In my maintain I have specified in a case that is linked to the Show button:
winform set StartScreen.PDFrame.source to "/ibi_apps/WFServlet?IBIF_ex=show_802&IBIAPP_app=myapp&ITEM=1"
but nothing ever gets displayed in my PDFrame iframe, no matter how often I click the Show button.

What am I doing wrong here?


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
December 12, 2007, 03:20 AM
Alan B
GamP

My understanding is that the URL for a frame cannot be dynamic, i.e you are unable to use a WINFORM SET after the form has been displayed.

However, the method I use is js, almost exactly as you have done, to achieve the same result.

The difference is that the 'show' button returns to the maintain, populates a hidden field with the url,that is then picked up in the js. The function 'Onbtn_Show_Click()' is called from a document.onload. First time in the url is blank, so nothing happen. Click show button, hidden field populated with url by maintain, page returns, document.onload calls function which picks up url, and frame populates.


Alan.
WF 7.705/8.007
December 12, 2007, 05:17 AM
GamP
Alan,
Thanks, this works like a charm, and exactly meets my requirements.
I knew I could depend on this forum to come up with a workable answer.
Very valuable!


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988