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

Open radwindow within another and set it acrive

3 Answers 175 Views
Window
This is a migrated thread and some comments may be shown as answers.
max
Top achievements
Rank 1
max asked on 23 Apr 2008, 09:35 AM
I cant set a radwindow active when I open it from another radwindow, this is the code I'm using:

    openSelectorWindow : function(ControlID,WindowUrl){ 
        var baseWnd = MyJsClass.GetRadWindow();  
        if (baseWnd) { 
            var url = WindowUrl+'?WindowID='+baseWnd.get_name()+'&ControlID='+ControlID;  
            var oWnd = baseWnd.GetWindowManager().Open(url, ControlID);  
            oWnd.set_visible(); 
            oWnd.setActive(); 
        } 
        else{  
            var url = WindowUrl+'?ControlID='+ControlID;  
            var oWnd = window.radopen(url, ControlID); 
        } 
    }, 
    GetRadWindow : function (){ 
        var oWindow = null;   
        if (window.radWindow) oWindow = window.radWindow;   
        else if (window.frameElement && window.frameElement.radWindow) oWindow = window.frameElement.radWindow;   
        return oWindow;   
    }, 

It seem that the setActive and the SetVisible functions dont't work in this case...

3 Answers, 1 is accepted

Sort by
0
Obi-Wan Kenobi
Top achievements
Rank 1
answered on 24 Apr 2008, 02:34 PM
I saw this example:
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Window/Examples/CommunicationBetweenRadWindows/DefaultCS.aspx
where a window is opened from another window.
I hope that it will help you.
0
Jim
Top achievements
Rank 1
answered on 30 Nov 2008, 12:43 AM
Unfortunately, the aspx for the RadWindows seem to have been omitted, making this example pretty much useless. Also, it would be really nice if the examples said what version then run in and when they were posted.  I spend a lot of time looking at obsolete stuff.
0
Svetlina Anati
Telerik team
answered on 01 Dec 2008, 08:50 AM
Hi James,

Thank you for the provided project, I was able to reproduce the described behavior.

I suggest instead of making the second window active just to open it with a little timeout as shown below:

   setTimeout(function(){  var oWnd = baseWnd.GetWindowManager().Open(url, ControlID);     
            oWnd.set_visible();    
            oWnd.setActive(); }, 0);  
 

Actually, timeout of 0 will also do the trick in case the content page is not too heavy and does not take a very long time to load.

All the best,
Svetlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
max
Top achievements
Rank 1
Answers by
Obi-Wan Kenobi
Top achievements
Rank 1
Jim
Top achievements
Rank 1
Svetlina Anati
Telerik team
Share this question
or