Open New RadWindow from Rad Window

7 posts, 0 answers
  1. Michael
    Michael avatar
    16 posts
    Member since:
    Apr 2009

    Posted 11 Jun 2009 Link to this post

    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
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 12 Jun 2009 Link to this post

    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.
  3. Michael
    Michael avatar
    16 posts
    Member since:
    Apr 2009

    Posted 16 Jun 2009 Link to this post

    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
  4. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 17 Jun 2009 Link to this post

    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.
  5. Casey
    Casey avatar
    299 posts
    Member since:
    Jul 2009

    Posted 07 Aug 2009 Link to this post

    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
  6. Casey
    Casey avatar
    299 posts
    Member since:
    Jul 2009

    Posted 07 Aug 2009 Link to this post

    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.
  7. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 10 Aug 2009 Link to this post

    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.
Back to Top