Focal Point
[CASE-OPENED] iframe onload event not fired for Firefox/Chrome and WF7.7?

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

March 19, 2014, 11:56 AM
linnex
[CASE-OPENED] iframe onload event not fired for Firefox/Chrome and WF7.7?
Hi all,

I have experienced a strange behaviour and wanted to ask if somebody else could verify if this is a bug (or "works as designed").

When I am creating an HTML report page (report request runs automatically) with WF 7.7.03 (HF6) in the Composer and add an html "onload" event to the generated iframe (e.g. "alert('report loaded');") - I experience different behaviour in Internet Explorer and Firefox (most likely in all other Std. Browsers as well):

The onload event is fired 3 times in IE - 2 times after the content of the report is loaded. Not nice but okay Wink

In Firefox the event is fired once before the content of the report is loaded and not at all after the content is available Frowner Mad Eeker

I believe the culprit is the ExecuteRequest function in IBIs ibirls3.js:

if (isIEvar)
	target.detachEvent("onload", SetResultingHtml);
else
	target.onload = null;


WF seems to actually completely delete/override the user-defined onload events of all executed iframes.

I have seen the same JS and behaviour on a WF 7.7.05 sandbox as well.

To me this seems highly buggy. Why not use target.removeEventListener(...) and addEventListener later on.

Is this behaviour still valid for WF 8.x?

Thanks in advance
Cheers
Linne

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 7.7.03
March 25, 2014, 01:19 PM
<Kathryn Henning>
Hi linnex,

We are aware of something similar where a check box or radio button that has an onclick event associated with the control will fire twice. It only occurs under specific browsers and versions.

So that we can review the behavior that you're seeing and verify your environment, would you please open a case on InfoResponse Online? Please reference this Focal Point topic in the comments.

Thanks and regards,

Kathryn
March 25, 2014, 04:56 PM
J
In the mean time, if you are trying to get the same functionality as you would expect with an iframe onload event, do something like this at the end of your report instead to guarantee report load everytime:
 
...
ON TABLE HOLD AS RESULT_X FORMAT HTML
END

-HTMLFORM BEGIN
<html>
<body onload="parent.onReportLoad();">
!IBI.FIL.RESULT_X;
</body>
</html>
-HTMLFORM END
 

This will put your report in the html tags and then you can call a function in your parent page in the body tag using the onload attribute.

This way the javascript code will only be loaded once the report has run. Instead of waiting for the iframe to load you are now waiting for the report to finish and then call that code once complete.


WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs
March 26, 2014, 03:43 AM
linnex
Hi Kathryn and J,

thank you both for your responses. I will gladly open a Case with IBI when I have the time.
@J: Interesting idea - I will definitively try this one out for HTML reports. The approach however (without trying - just a quick though about it) is not feasible with Graphs right? Have you done something similar with graphs already?

Thanks and cheers
Linne


WebFOCUS 7.7.03
March 26, 2014, 09:33 AM
J
This will work for a graph as well (provided the output is still html...). You may be able to embed the other formats in the html as well, but I'll let you figure that one out.
 
GRAPH FILE CAR
SUM CNT.CAR.COMP.CAR 
ACROSS CAR.COMP.CAR 
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET VZERO ON
ON GRAPH SET GRID ON
ON GRAPH HOLD AS RESULT_X FORMAT HTML
ON GRAPH SET GRAPHSTYLE *
setMarkerDisplay(true);
setConnectLineMarkers(false);
setConnectScatterMarkers(false);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(true);
setO1MajorGridStyle(0);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"#.##");
setPieFeelerTextDisplay(1);
setPieLabelDisplay(0);
setTextFormatPreset(getPieSliceLabel(),1);
setRiserBorderMode(1);
setSeriesDefaultTransparentBorderColor(true);
setUseSeriesBorderDefaults(true);
setLegendDisplay(true);
setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeAbsolute(getY2Title(),true);
setFontSizeAbsolute(getY2Label(),true);
setFontSizeAbsolute(getO1Title(),true);
setPlace(true);
ENDSTYLE
ON GRAPH SET STYLE *
$
ENDSTYLE
END
-HTMLFORM BEGIN
<html>
!IBI.FIL.RESULT_X;
</body>
</html>
-HTMLFORM END
 



WebFOCUS 7.7.03/8.0.08
Dev Studio 7.7.03/8.0.08
App Studio 8.0.08
Windows 7
ALL Outputs