This is a migrated thread and some comments may be shown as answers.

Ro find when ContentUrl has started loding

3 Answers 87 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
Rocky
Top achievements
Rank 1
Rocky asked on 23 Jan 2009, 08:27 PM

I was using Iframe to load my reports and I was able to call a function when the report gets loaded. I have menu items for each reports and the new reports gets loaded in iframe. Our reports are very huge and takes time even before we see the new repots gets loaded in iframe.
 
<iframe frameborder="0" scrolling="no" marginwidth="0" marginheight="0" align="left"  id="ReportFrame" onload="stopAnimation()" ></iframe>

Now I am using RadPane to generate two reports side by side. I am setting , but there is no way for me to know
 
<telerik:RadSplitter id="RadSplitter1" runat="server" width="100%" height="800" Orientation="Vertical">  
<telerik:RadPane id="LeftPanel" runat="server">
</telerik:RadPane>
<telerik:RadSplitBar id="RadSplitBar1" runat="server" collapsemode="Both"></telerik:RadSplitBar>
<telerik:RadPane id="RightPanel" runat="server">
</telerik:RadPane>
</telerik:RadSplitter>

<script type="text/javascript">
function renderReport(url) {

var splitter = $find("<%= RadSplitter1.ClientID %>"); 
var vLeftPanel = splitter.getPaneById("LeftPanel");
var vRightPanel = splitter.getPaneById("RightPanel"); 
 
vLeftPanel.set_contentUrl(url);
vRightPanel.set_contentUrl(url);
setTimeout('stopAnimation()', 1000);
}

function stopAnimation() {
var splitter = $find("<%= RadSplitter1.ClientID %>");
var vRightPanel = splitter.getPaneById("RightPanel");
if (vRightPanel.isExternalContent()) {
var silverlightObject = document.getElementById("ReportSilverlightControl"); silverlightObject.content.SilverlightJSCaller.StopLoadingAnimation();
return;
}
else {
setTimeout(
'stopAnimation()', 1000);
}
}

isExternalContent() returns true soon after the url is set and not when the page is loaded. There is no way for me to know when the RadFrame has started loading the way I used to do for IFrame.

Can someone please helpme in knowing how can I get this working.

3 Answers, 1 is accepted

Sort by
0
Rocky
Top achievements
Rank 1
answered on 23 Jan 2009, 09:38 PM
I just found that RadPanes with contentURL will be rendered within IFrame. Is there a way I can add onload even to Radpane like: 

<

 

telerik:RadPane id="TopPanel" runat="server" OnLoad="afterLoad">

 

 

But adding onLoad to RadPane tag throws error.

0
Rocky
Top achievements
Rank 1
answered on 24 Jan 2009, 12:56 AM
The other issue I am facing after the sue of RadPane is it takes longer time for second report to even show up in the pane after I click the new menu. The time taken to show up report in my previous Iframe and RadPane is same for the first time. But when I click on the new menu item when the first report is still loading, the iframe works better when compared to radPane. In Rad pane, the new report doesn't get loads until the first report is completed loaded and then the second report starts getting loaded.  Our reports are very huge and it takes about 1 minute to get generated.

Is there a way to void the loading of first report when the new report menu item is clicked. Else the users will have to wait until the first report is completely loaded before the second report start getting loaded. This issue wasn't there when I was using Iframe.
0
Svetlina Anati
Telerik team
answered on 27 Jan 2009, 08:06 AM
Hello Rocky,

Straight to your questions:

  1. As you have found out yourself, when you set the RadPane's ContentUrl property an IFRAME element is created. You can reference this IFRAME by using the RadPane's client API and in particular the getExtContentElement method. Once you have referenced the IFRAME you can work with it in the standard manner since it is a standard element.
  2. Since the RadPane with a ContentUrl is  actually an IFRAME, there should not be differences in the behavior. I also tested the behavior in this online demo but could not noticed the described problem. If the problem persists, please open a new support ticket and send us a reproduction demo with a standard IFRAME and a RadPane, detailed reproduction steps and description of the actual and the desired behavior.
Sincerely yours,
Svetlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Splitter
Asked by
Rocky
Top achievements
Rank 1
Answers by
Rocky
Top achievements
Rank 1
Svetlina Anati
Telerik team
Share this question
or