Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] How to auto refresh iframe and swap from one to the other

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] How to auto refresh iframe and swap from one to the other
 Login/Join
 
Virtuoso
posted
Hi,
I have an HTML page that contain 2 iframe.
I would like to swap (display) from frame1 to frame2 every 30 sec.

Every single js that I put in doesn't work as it should. It either gives an error: "object cannot support reload()" or popup an advisory to authorize the resent of information or do nothing at all.

I've tried with metatag but it refresh the whole page.

Does someone can help on that ?

Regards,

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


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Gold member
posted Hide Post
Hi Martin

Rather than inserting two iframes, insert two reports. When inserting a report the system creates a frame anyhow but then you can use: IbComposer_execute('report1','report2') where report2 is the location. You can use a javascript timer to execute the command every 30 seconds. Will have to use a global var in JavaScript for the location to run the report.

Thanks Barry


WebFOCUS 8103, Windows, App Studio
 
Posts: 80 | Location: NYC | Registered: November 13, 2008Report This Post
Master
posted Hide Post
Martin,

Can you please provide the piece of JS you are using to do this functionality? We will be able to assist you better once we understand what you have tried to do so far.

As Barry points out the tool will create the iframes for you, but I'm not sure thats your issue. From what I'm reading I think you want to A)switch between the two reports and B)you want to refresh the reports every 30 seconds. Allowing you to refresh one while its hidden so the user doesn't see the refresh.

If I were doing this. I would use the css display attribute to make one Iframe visible and hide the other. I would then use the OnExecute(form) function to refresh whichever one I just hid. I would then wrap this function with a timeout function that fires every 30 seconds.

Eric


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
 
Posts: 750 | Location: Warrenville, IL | Registered: January 08, 2013Report This Post
Virtuoso
posted Hide Post
Yes Eric, this is what I'm trying to do : refresh reports and switch from one to the other every 30 seconds.

I've tried many JS that I found on Google :-) but none seems to work as I need.

Here is the code with the " object do not support reload function" message

setInterval("refresh();", 10000);

function refresh()
{
	var ifrm = document.getElementById("EXPLIST");


	ifrm.location.reload();

}



The cal to setInterval is places in the OnLoad function. And in this, I tested with 10 seconds. EXPLIST is my iframe name.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Master
posted Hide Post
Martin,

If you let the HTML Composer create the IFrames for the report for you, then you could use the code OnExecute(form1); where form1 is the id of your form for your inputs. You should see this in the onsubmit attribute of the form. If you didn't create a form, I believe the syntax is href="javascript:OnExecute(null, 'anchor1')" where anchor1 is the id of the element that specifies which request list to execute.

The html Composer creates a series of xml in the document which controls what information is passed, defaults, and a number of other things. In this case the important thing to be aware of is the requestlist attribute. This attribute specifies which report is being fired off and there will be an xml tag that relates to each requestlist at the bottom of the page.


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
 
Posts: 750 | Location: Warrenville, IL | Registered: January 08, 2013Report This Post
Virtuoso
posted Hide Post
Thanks to both of you.

I finally make it run using one iframe that display reportA or reportB from a loop with IbComposer_execute. In this sampl code I refresh every 10 seconds.


function window_onload() {
 
	UpdateData();
	loop = 1;

	setInterval("refresh();", 10000);
}

function refresh()
{
	if (loop == 1)
	{
		IbComposer_execute('PICKLIST', 'RPT_FRM');
		loop = 2;
	}
	else
	{
		IbComposer_execute('EXPLIST', 'RPT_FRM');
		loop = 1;
	}
}



WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] How to auto refresh iframe and swap from one to the other

Copyright © 1996-2020 Information Builders