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

Open New RadWindow from Rad Window

6 Answers 268 Views
Window
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 11 Jun 2009, 03:36 PM
I need a little direction here. 

I open a RadWindow from my main page.  Inside the RadWindow I have a button called "Upload".  When clicked, I want to open a second RadWindow.  However, I'm stuck right now because what should open as a second RadWindow is actually replacing the content of the first RadWindow.

How can I solve this problem?  Comments would be appreciated!

Michael

6 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 12 Jun 2009, 06:04 AM
Hi Michael,

Checkout the online demo which demonstrates opening a radwindow from another radwindow. In this example, the second radwindow is opened by obtaining a reference to the RadWindowManager (which is on the parent page), and using its open() method.
Window / Returning Values from a Dialog

Go through the following link for more information on this:
Opening a RadWindow from Within a RadWindow

-Shinu.
0
Michael
Top achievements
Rank 1
answered on 16 Jun 2009, 05:34 PM
Very nice!  Thanks for the help. 

Now, it just so happens that my 2nd RadWindow is smaller in size that the 1st.  Since the 1st is still open, the 2nd opens behind it and the user can't see it there.  How can I make the 2nd RadWindow take focus?

Thanks!

Michael
0
Georgi Tunev
Telerik team
answered on 17 Jun 2009, 11:29 AM
Hi Michael,

For this you need to use the setActive() method with a small timeout.
For example (following the code in the help article that Shinu posted)

var oBrowserWnd = GetRadWindow().BrowserWindow; 
var oWnd2 = oBrowserWnd.radopen("http://www.google.com""NewWindow"); 
window.setTimeout(function() 
    oWnd2.setActive(true); 
},100); 


Best wishes,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Casey
Top achievements
Rank 1
answered on 07 Aug 2009, 06:48 PM
Georgi,

I have a situation similar to Michael's. I open a RadWindow from an OnClientClick event of a hyperlink on another RadWindow; however, the RadWindow I opened up goes behind the first RadWindow. In my case, I can still see the 2nd RadWindow because I maximize this window in the javascript PageLoad function. I tried adding the code you suggested to Michael when opening the 2nd RadWindow, but I am still experiencing the issue.

Also, this does not happen the first two times that I open a RadWindow from the 1st RadWindow. It only happens after the second time. So, I open a RadWindow from the 1st RadWindow, then close the 2nd RadWindow and the first RadWindow is visible again. I then open different RadWindow from the 1st RadWindow and then close it. The 1st RadWindow is visible again. When I go to open a different RadWindow from the 1st RadWindow it opens, maximizes and then is displayed with the 1st RadWindow over top of it.
 
Code to open 2nd RadWindow:
function OnClientClick_EMP() {  
            var oWindow = GetRadWindow().BrowserWindow;  
            var oWnd2 = oWindow.radopen("EmpRosterReport.aspx""EmpRost");  
            window.setTimeout(function() {  
                oWnd2.setActive(true);  
            }, 100);  
        } 


Code on RadWindow opened from 1st RadWindow:
 function pageLoad() {  
            var oWindow = GetRadWindow();  
            oWindow.maximize();  
        }  
    
        function GetRadWindow() {  
            var oWindow = null;  
            if (window.radWindow) oWindow = window.radWindow;  
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;  
            return oWindow;  
        } 
 
I am using the 2009 Q1 release of Rad Controls on IE 8.

Thanks,
Casey
0
Casey
Top achievements
Rank 1
answered on 07 Aug 2009, 07:30 PM
My original observation that this occurs only after opening a 3rd RadWindow from the 1st RadWindow is incorrect. This occurs after I open up the 1st RadWindow from the parent page, then open up a 2nd RadWindow from the 1st Radwindow. On the 2nd RadWindow there is a RadComboBox populated by a SQLDataSource. Once the user selects a date, the value selected is passed to another SQLDataSource that populates a RadGrid on the same page. The SelectedIndexChanged event calls a method that rebinds the RadGrid. Once I go through this process, and then close this RadWindow (2nd RadWindow) and open a new RadWindow from the original RadWindow, the issue occurs. If I go to the RadWindow with the RadComboBox and simply close the RadWindow without selecting any values from the RadComboBox, then open a new RadWindow from the original RadWindow, the issue does not occur.
0
Georgi Tunev
Telerik team
answered on 10 Aug 2009, 06:42 AM
Hi Casey,

Please open a support ticket and send us a small sample project that shows your exact setup and the problems with it. We will check it and get back to you with solution right away.

Thank you in advance for your cooperation.

Kind regards,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Window
Asked by
Michael
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Michael
Top achievements
Rank 1
Georgi Tunev
Telerik team
Casey
Top achievements
Rank 1
Share this question
or