Focal Point
[Work Around] Wait Message And Report in an iFrame ~ Revisiting

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

June 08, 2011, 04:04 PM
Doug
[Work Around] Wait Message And Report in an iFrame ~ Revisiting
Here’s what I need is to have an animated GIF display in an iFrame while we wait for the execution of a report to be displayed in the same iFrame.

Here’s what I have thus far [Report, Launch Page, Wait Message, and Animated GIF ]:

1) A Launch Page, with a "Run" button, to provide values to a fex which will be displayed in an iFrame.
  a. This Launch Page will display the next two items, Wait Message and Report, in the same iFrame.
2) Wait Message: an HTM file while contains a message and an Animated GIF.
  a. This will be displayed in the iFrame upon “clicking” the “Run” button and will be overlaid by the report when it completes.
3) A Report, report.fex, which displays a report.

What I’m missing is the piece of the puzzle which makes it work as desired (all in the same iFrame).

I’m thinking that the “Run” button should execute an htm file which auto-executes the (embedded) fex after the Animated GIF is displayed. The problem is that I cannot remember how to do this and cannot find it in my archives from FDMS (2005).

Any insight would be greatly appreciated.

Reference files: Report, Launch Page, Wait Message, Animated GIF.

Thanks, Doug

This message has been edited. Last edited by: Doug,




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
June 08, 2011, 04:13 PM
Severus.snape
Hi,

Here is what i use in all my reports.
On click of the run button call a JS function which will load a gif or you can directly load a html file into the iframe and it calls the ibi function onexecute to run the report and it overwrites the iframe with the report.
  
my_window= window.open ("","iframenamewhichis usedtoloadreport/gif");
my_window.document.write('<img src="../approot/baseapp/images/report_wait.gif" alt="Wait" style="Z-INDEX: 7;  LEFT: 570px;  POSITION: absolute; TOP: 250px; " border="0"></img>');
my_window.document.body.style.cursor="wait";

OnExecute('','form2');
or 
setTimeout("OnExecute('','form2')",300);
to wait for the gif to load



thanks
Sashanka


WF 7.7.03/Windows/HTML,PDF,EXL
POC/local Dev Studio 7.7.03 & 7.6.11
June 08, 2011, 04:24 PM
Francis Mariani
I haven't tried this, but can you add a line of code that loads the Please Wait HTML file into the iframe before running the request. Something like:

//Begin function button1_onclick
function button1_onclick(ctrl) {
// TODO: Add your event handler code here
iFrame.location = "location of please wait file";
OnExecute(ctrl)
}
//End function button1_onclick



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
June 09, 2011, 03:13 PM
Doug
Thanks Guys, "Close, but no cigar" (yet)...

I need the launch page to execute an HTM which displays an animated gif while the embedded report processes. Kinda like the "wait message" that comes up while the controls of a launch page are being processed / populated.

Sweating but Still Hopeful
June 09, 2011, 03:34 PM
Francis Mariani
This post was written some time ago, but it might work for you - I followed up on my original post with an example within an iframe: [CODE] A simple "Please Wait" message WITH an animated image!.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
June 13, 2011, 10:34 PM
dbeagan
Doug, are you looking for something like this?

 
-DEFAULT &PARM1 = 'Val1';
-DEFAULT &PARM2 = 'Val2';
-HTMLFORM BEGIN
<html>
<head></head>
<body onload=document.frm1.submit();>
<img src='../approot/baseapp/loading.gif'></img>
<h3> Running ... </h3>
<form name=frm1 action="/ibi_apps/WFServlet" method="post" target="_self">
<input type=hidden name="IBIF_focexec" value="carinst">
<input type=hidden name="IBIAPP_app" value="ibisamp">
<input type=hidden name=PARM1 value="!IBI.AMP.PARM1;">
<input type=hidden name=PARM2 value="!IBI.AMP.PARM2;">
</form>
</body>
</html>
-HTMLFORM END



WebFOCUS 8.2.06
June 17, 2011, 02:22 PM
Doug
Thanks dbeagan,

Yes, That's what I was looking for.

However, I got this work around while I was at Summit 2011 this week:

1: Add the two "doc..." lines in the HTM file (launch page):
// in my HTML:
//Begin function button1_onclick
function button1_onclick(ctrl) {
  document.getElementById('text1').style.visibility='visible';
  document.getElementById('image1').style.visibility='visible';
// TODO: Add your event handler code here
OnExecute(ctrl)
}
//End function button1_onclick

2: Add a closing HTMLFORM in my fex (after execution)
-* In my FEX:
-HTMLFORM BEGIN
<SCRIPT>
window.parent.document.getElementById('text1').style.visibility='hidden';
window.parent.document.getElementById('image1').style.visibility='hidden';
</SCRIPT>
-HTMLFORM END

Now we all have two solutions to this issue.

My concern, which I'll discuss more with IB, is that the "normal" loading message doesn't work when displaying a report into an iFrame (as expected).

Thanks Bernie.

This message has been edited. Last edited by: Doug,




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
June 20, 2011, 02:18 AM
Dave
All,

I made something like this in the past.

Did you know :
Webfocus 7702 does this automatically.


_____________________
WF: 8.0.0.9 > going 8.2.0.5
June 20, 2011, 04:21 AM
linnex
Hi Doug,

quote:
2: Add a closing HTMLFORM in my fex (after execution)


Just as a hint: wouldn't it be "cleaner" to use the onload event of the iframe (in the main report page) in which the report is running to hide the text and gif again. iframe onload is called when the iframe has finished loading the report.
window.parent.document
etc. can be problematic if you will change the hierarchy of your html windows and frames (e.g. if your html page is not the direct parent anymore. And you always have to kind off "synchronize" two files together e.g. if you change the id of "text1".

I am using a similar combination of button.onclick & iframe.onload events sucessfully to display an overlay "waiting" text+animated gif for my reports.

Regards, Bastian


WebFOCUS 7.7.03
June 20, 2011, 09:41 AM
Doug
Dave: Yeah... There in lies the issue. it does not work with iFrames here (time to open a case). It does work when populating controls in a launch page.

linnex: Thanks for your insight. I'll consider that for my next application (if it's not fixed to work as desginged by then). This app / iFrame, etc, is a small project and is rather static.




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
October 10, 2011, 03:15 PM
Doug
Allow me to add to this with another scenario.

How about executing of a fex from within a Launch Page (with parameters) which displays a "wait message" (in a new window / tab) at the click of the "Run" button, then goes away when the report comes back to display. This also needs to work for PDF, AHTML, and EXL2K.

Confused




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206