View Full Version : [CLOSED] HowTo AutoLoad a relative path IFRAME into each tab

Sep 29, 2008, 1:28 AM
I can't figure out how to do the following and would appreciate any pointers:

I want each tab in a TabPanel to contain an IFRAME, where the IFRAME SRC is a relative path (i.e. "..\IFrameTarget.aspx"). And, I want the IFRAME to only load when the tab is selected.

Assigning the Tab.AutoLoad to the <iframe> string like below doesn't work. The tab just says 'loading...' and never loads.

tab.AutoLoad = "<iframe src='..\IFrameTarget.aspx' id='iFrame1' ></iframe>";

I saw in another thread where if the AutoLoad string begins with an 'http' like below, that an IFrame is automatically generated.

tab.AutoLoad = "http://somesite.com";

This is cool, however this won't work with relative urls such as "..\IframeTarget.aspx" because they dont begin with "http". I've suggested an enhancement request for an AutoLoadIFrame feature that will assume the url is value and will AutoLoad the tab with the appropriate <iframe> when it is selected.

In the mean time, I'm trying to build this myself with script. Calling an OnTabChanged event is easy enough, but I can't figure out three things:

1) How to set the tab.html = "<iframe ....></iframe>" on the client side
2) How to tell if the tab's html has already been set from a previous selection
3) How to have a 'Loading..." graphic appear while the IFrame is being loaded.

Any help would be appreciated.

Sep 29, 2008, 2:10 AM
Hi Randy,

There is Html property, so you can set any html directly.

tab.Html = "<iframe src='..\IFrameTarget.aspx' id='iFrame1' ></iframe>";

Sep 29, 2008, 3:29 AM

Yes, I know. And that is what I'm using in the mean time.

However, setting the Tab.html to an <iframe> like this causes all the tab's IFRAME's to be loaded when the page is first rendered. What I want is to only have each tab's IFRAME loaded when the tab is selected, like the AutoLoad does.

Sep 29, 2008, 4:59 AM
Hi Randy,

I think the DeferredRender=true property of TabPanel can help to avoid iframe loading on page load

Sep 29, 2008, 5:28 AM
The .AutoLoadIFrame property has been added. Setting the .AutoLoadIFrame property with a url (local or remote) will automatically create an <iframe> and set the src attribute to the url.

I'm working on a full sample demonstrating the .Html, .AutoLoad and .AutoLoadIFrame properties. The sample should be available shortly. 

Hope this helps.

Sep 29, 2008, 9:57 AM
Outstanding Geoffrey.


Oct 02, 2008, 12:38 PM
Version 0.6 is available (http://www.ext.net/download/) and now includes the .AutoLoadIFrame property.

Code samples will be available later today.

Hope this helps.