View Full Version : [CLOSED] Tab and AutoloadIframe

Oct 10, 2008, 5:08 PM
Is there a possibility of knowing in the code behind or on the clientside, if the Iframe is loaded with a page.

My situation is, when a Person clicks on the tab, I load a page in AutoLoadIframe.

Now when he returns back to the tab, after visting other tab, I dont want AutoLoadIframe to load the page again. It should check, if the page is loaded, if already loaded then dont do anything.

Any sample will be much appreciated!!


Oct 10, 2008, 5:19 PM
Sounds like you might have AutoPostBack enabled on your TabPanel?

If you disabled it; it would stop automatically loading your IFrames :)


Oct 10, 2008, 6:06 PM
AutoPostBack is by False.

I set my Tab AutoIframe on the server side. Not on the Client side. I dont mind doing it in the client side too, I can use listeners and do it.

The situation is this:
1) Page Loads with 2 tabs. Tab1 Autoloadiframe set to some page. Loads Perfectly.
2) Tab2, AutoLoadIframe not set by default. It is set on Client Activate Event. Goes to server and sets it. Loads Perfectly (Will surely change it to Client Side. Just for testing.)
3) When I go back to Tab1, the page loaded by default, is still active. No refreshes in tht Iframe of Tab1.
4) When I now return to Tab2, It reloads, the Iframe content.

Reason: Because it sets it on the server.

Therefore, I need to know if its possible, to check sumwhere if the Iframe is Loaded (Either Server Side or Client Side). So that on 2nd time click, it does'nt reload the page.

<ext:Tab runat="server" Title="Add IOA" ID="addioa" >
<AjaxEvents >
<Activate OnEvent ="addioa_Load" EventMask-ShowMask="false" ></Activate>

Protected Sub addioa_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles addioa.StateChanged
///Wanna Check here if it already has page loaded. I am happy if you can tell me any JS to check on Client Side too.
Me.addioa.AutoLoadIFrame = "addioa.aspx"
End Sub

Oct 10, 2008, 8:31 PM
Hi Amit,

You might want to add a hidden field to the page somewhere and set a value if the Tab has been activated once before. 

That hidden field could then be checked both server-side and client-side.

Oct 11, 2008, 4:56 AM
Is'nt that going to be just a workaround? I have multiple tabs doing
this. Could we have a property like "isiFrameLoaded", which will set to
true if Autoload or AuloadIframe was set?


Oct 11, 2008, 7:32 AM
You might want to look into extending the TabPanel/Tab to wrap up the hidden IFrame functionality so you do not have to manually add the hidden field for each Tab instance.

The ManagedIframe (http://extjs.com/learn/Extension:ManagedIframe) Extension may be another good option although I'm not 100% sure it provides the functionality you desire. But, it would make a great UX control that you could share with the community.

Oct 11, 2008, 10:16 AM
Hmm...I will try extending... Will also tell you in a seperate post, y I wanted this functionality.

In Brief: I am using a user Control, in 2 pages. Both pages load in a tab, Tab 1 and Tab 2 Respectively.

When the Page Loads, the Control is not render properly in Tab2. Everythign looks weird on Tab2. However, When I explicitely load it in code behind, It does render perfectly. Will send you a sample soon to review.

About the UX, I have never made a control, so will need a good reading before I start...

I was looking at making a Web Desktop kind of thing with Coolite... Hope m able to... But I think I will have to wait until 0.7 to do that.

Thanks for your help,