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

Radwindow unable to retain the various properties set in .aspx page

6 Answers 125 Views
Window
This is a migrated thread and some comments may be shown as answers.
giridhar
Top achievements
Rank 1
giridhar asked on 20 Jan 2009, 03:25 PM
Hi,
  Currently I working in a scenario where RAD WINDOW is present in Parent.aspx and we have child.aspx in IFRAME of Parent.aspx....
I have provided a link in child.aspx which opens the radwindow of parent.aspx.

Problem: Now open the radwindow in parent clicking on link in child. It opens fine. Close the window. Again click the link. Now rad window is distorted. It's unable to retain the attributes like Height, Width, Behaviour etc... set in .aspx .

i.e second time when you open rad window it's a problem.

Code is as follows:
Parent.aspx

    <rad:RadScriptManager ID="RadScriptManager1" runat="server" OutputCompression="AutoDetect" >
    </rad:RadScriptManager>
        <rad:RadWindowManager Skin="Vista" DestroyOnClose="true"  id="Singleton" runat="server">
            <windows>
                <rad:RadWindow Runat="server" Modal="true" Height="450" Width="850" Visible="true" VisibleStatusbar="false" Title="SumTotal" EnableEmbeddedSkins="false" Skin="Vista" VisibleTitlebar ="true" Behaviors="Close" Behavior="Close" ID="DialogWindow"></rad:RadWindow>
            </windows>
        </rad:RadWindowManager>


child.aspx

<div id="Div1" runat="server">
   <script type="text/javascript">
        function openWindow()
        {
             var oWindow = null;
             var strURL = "LMS_User_ExceptionDetail.aspx?EmpID=5195&EmpName=Emily%20Arroyo&ViewDataMode=0";
             oWindow = window.parent.radopen(strURL, "DialogWindow");      
        }
    </script>
</div>


<a href='javascript:openWindow();'>test</a>

6 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 20 Jan 2009, 03:33 PM
Hello giridhar,

This happens because you have set the DestroyOnClose property to true. When this property is set to true, RadWindow's object is destroyed once it is closed. This means that you will not be able to open that same RadWindow again, until the page is reloaded - a new RadWindow with default settings will be opened instead. In such scenario, we recommend to either set the needed properties (width, height, etc.) to the RadWindowManager or to set them by using the client-side API.



Greetings,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
giridhar
Top achievements
Rank 1
answered on 21 Jan 2009, 06:15 AM
Yep, this served the purpose. Thanq u :D.
0
AlphaVegas
Top achievements
Rank 2
answered on 21 Jan 2009, 08:50 PM
I have an additional question regarding this;

I had the same issue, my RadWindow's were not retaining their properties. Changing DestroyOnClose="False" solved the problem.

However, I am using a single .aspx page to serve 2 different forms. I am passing in a 'type' QueryString (?type="Form1") to the .aspx page when the window is fired to open.

The problem is that if DestroyOnClose="False" only 1 form is ever displayed.

Opening 'Form1' triggers the window to open and the .aspx page grabs ?type="Form1" and displays Form1 info correctly. When I close the Window and click the other link to open Form2, which passes ?type="Form2" to the same window and same .aspx page, Form1 is displayed again.

It seems that I need DestroyOnClose="True" for this scenario to work as desired, except that my Window properties are then lost each time the window is re-opened.

Is there a workaround for this?

TIA,
A.
0
Fiko
Telerik team
answered on 22 Jan 2009, 03:36 PM
Hi AlphaVegas,

If I understand your scenario correctly, the old information is displayed in the second RadWindow and then is replaced with the new version. If this is so, try setting ReloadOnShow to true and ShowContentDuringLoad to false - this should fix the problem.

If this is not the case, please open a support ticket and send us a sample project so we can have a better view over your exact scenario.

 
Kind regards,
Fiko
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
AlphaVegas
Top achievements
Rank 2
answered on 22 Jan 2009, 04:54 PM
Thank you Fiko! That is exactly what I was looking for. Adding ReloadOnShow="true" solved the problem. So simple!

Thanks again,
A.
0
Fiko
Telerik team
answered on 23 Jan 2009, 05:07 PM
Hello AlphaVegas,

It is good to know that everything is working fine now. Let us know if you need any further assistance - we will be glad to help.

Best wishes,
Fiko
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
giridhar
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
giridhar
Top achievements
Rank 1
AlphaVegas
Top achievements
Rank 2
Fiko
Telerik team
Share this question
or