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

Old Content Displayed on Load

3 Answers 79 Views
Window
This is a migrated thread and some comments may be shown as answers.
Darren Nicholl
Top achievements
Rank 1
Darren Nicholl asked on 16 Jul 2011, 07:54 AM
Hi

We have a radwindow that is used to display a variety of reports

 

 

<telerik:RadWindowManager ID="RadWindowManager1" runat="server" VisibleStatusbar="false"
        ReloadOnShow="true" RestrictionZoneID="MainArea">
        <Windows
            <telerik:RadWindow ID="ReportWindow1" runat="server" KeepInScreenBounds="True" Modal="True"                
                Behaviors="Close,Maximize" Height="800px" Width="1000px"
                ShowContentDuringLoad="True"  Title=""  EnableEmbeddedSkins="False" DestroyOnClose="False">
            </telerik:RadWindow>              
        </Windows>
    </telerik:RadWindowManager>

The issue is that if you close the window when it had one report open and reopen it with a new report, the previous title is displayed until the page loads.

This happens even if destroyonclose is set to true (for some reason it also ignores the sizeing when you open it the second time as well when destroyoclose is tue)

Why does it do this?

Cheers

3 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 20 Jul 2011, 12:42 PM
Hi Darren,

  The RadWindow takes its title from the Page.Title property, which means that it has to load the page first. You can work around that by setting the title to an empty string via JavaScript in the OnClientShow event so that it will not show the old one:
function OnClientShow(sender, args)
{
    sender.set_title("");
}


As for the DestroyOnClose property - it disposes the RadWindow object when you close it, so the next time you do not open the same RadWindow, but a new one that inherits the RadWindowManager's properties, and there you have not set any dimensions, so it assumes the default 300 by 300 pixels. This also means that the title will not persist when it is closed.

 

Regards,
Marin
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Darren Nicholl
Top achievements
Rank 1
answered on 22 Jul 2011, 10:39 AM
Is that not set by the Height and Width properties, set to 1000 and 800?
0
Marin Bratanov
Telerik team
answered on 22 Jul 2011, 04:16 PM
Hello Darren,

This is exactly the point in the DestroyOnClose property - it removes the closed RadWindow object from the page, which means that it no longer has these properties set. You can imagine that the markup looks like this while the RadWIndow is opened for the first time: 
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" VisibleStatusbar="false"
        ReloadOnShow="true" RestrictionZoneID="MainArea"
        <Windows>  
            <telerik:RadWindow ID="ReportWindow1" runat="server" KeepInScreenBounds="True" Modal="True"                
                Behaviors="Close,Maximize" Height="800px" Width="1000px"
                ShowContentDuringLoad="True"  Title=""  EnableEmbeddedSkins="False" DestroyOnClose="False"
            </telerik:RadWindow>               
        </Windows
    </telerik:RadWindowManager>

and then after you close it for the first time you can image it looks like this:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" VisibleStatusbar="false"
        ReloadOnShow="true" RestrictionZoneID="MainArea"
    </telerik:RadWindowManager>

This means that a new call to radopen("URL", "ReportWindow1") is now equivalent to radopen("URL", null) which will result in a new window with the settings from the RadWIndowManager.

All the best,
Marin
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Window
Asked by
Darren Nicholl
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Darren Nicholl
Top achievements
Rank 1
Share this question
or