Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Iframe loads twice when the source is set dynamically in JET

1005466Aug 4 2016

Hi Experts,

We have an ADF application that is loaded on JET page using iframe.

The iframe source URL is set to the ADF page along with the required parameters in JS using ko.observable. However, I see that when the JET application is run, ADF content in the iframe loads fine but the call to ADF page is made twice. This is resulting in the ADF being run twice like the queries and the method calls are done twice which is performance overhead.

Moreover, when I navigate back from the JET page as well, the ADF code is triggered again.

Checked through some resources on the web and found that iframe whose source is dynamically set has some issues and loads twice but could not get the solution correctly in my case.

http://stackoverflow.com/questions/10781880/dynamically-crated-iframe-triggers-onload-event-twice

It would be great if anyone can help in resolving this as this is a critical issue for us now.

Below is the rough JS and HTML code. Any pointers would be greatly appreciated:

JS code:

--------------------------------------

...............

...............

param="param1=100";

if(a=b)

param = param + "&param2=200";

else

param = param + "&param2=300";

pathname="http://127.0.0.1:7101/myADFapp/faces/main";

path = pathname + "?" + param;

srcPath=ko.observable(path);

...............

...............

--------------------------------------

In the html I set the iframe source using the data-bind as below:

--------------------------------------------

<div class="oj-panel oj-md-12 oj-lg-12 oj-xl-12">

<div>

     <div id="moduleHeaderWrapper" data-bind="ojModule: moduleHeaderSettings"></div>      

</div>

<iframe data-bind="attr:{src : srcPath}" id="if1"></iframe>

</div>

-----------------------------------------------

Comments
Post Details
Added on Aug 4 2016
0 comments
585 views