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

Wrong Window direction (new window is not on top)

4 Answers 108 Views
Window
This is a migrated thread and some comments may be shown as answers.
Ole Albers
Top achievements
Rank 2
Ole Albers asked on 26 Jan 2009, 10:08 AM
Hi there.

I got a modal which opens another modal radWindow through simple Javascript:


<href ="#" onclick="AddAttachment('OINK')"><img src="../Styles/Images/attachment.gif" style="border-width:0px;" /></a

The JScript part looks this way:
 function AddAttachment(paras) { 
            var oBrowserWnd = GetRadWindow().BrowserWindow; 
            oBrowserWnd.radopen("../dlg/UploadFile.aspx?emailID=50""Upload"); 
        } 
 




Now the second window is opened BEHIND the first window. I tried to modifiy the Z-Index of the radwindowmanager. I also added a
<body onload="setActive()">

to the second window with no affect.

I GUESS the Link-Click activates the first window after the popup has appeared so it jumps back to the opening window. Any idea how to solve that issue?

P.S:
Sorry. Wrong Topic (which I cannot change). Of course I meant "Wrong window order (not direction)"

4 Answers, 1 is accepted

Sort by
0
Accepted
Svetlina Anati
Telerik team
answered on 26 Jan 2009, 11:14 AM
Hi Ole,

I suggest to try opening the second RadWindow with a little timeout, e.g

function AddAttachment(paras) {    
            var oBrowserWnd = GetRadWindow().BrowserWindow;  
setTimeout(function(){    
            oBrowserWnd.radopen("../dlg/UploadFile.aspx?emailID=50""Upload");}, 300);    
        }    
 

You can play around with the timeout and find the optimum solution for your particular case. In case this does not help, open a new support ticket , prepare and send us a simple reproduction demo along with a detailed explanations and we will do our best to help.

Sincerely yours,
Svetlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ole Albers
Top achievements
Rank 2
answered on 26 Jan 2009, 12:33 PM
That solved it.

Thanks.
0
Andy
Top achievements
Rank 1
answered on 04 Feb 2009, 10:25 AM
Hello,

I had this problem a couple of months ago and through reading the support tickets I found the setTimeout method which worked fine until I upgraded to the latest release (Q3 2008 1314). Now, if the window i am in is in full screen mode and i open the new window it always opens behind. This is even with a 10 second delay.

Any advice would be great!

Thanks,

Andy
0
Svetlina Anati
Telerik team
answered on 04 Feb 2009, 11:04 AM
Hi Andy,

We introduced new z-index mechanisms for a maximized RadWindow due to customers' requests for various scenarios and that I assume that this causes the problem in your case. I suggest to do the following in order to fix the problem:

  1. Every time you open a new RadWindow or you activate such, keep it in a global variable in order to extract its z-index later.
  2. Every time you activate a new RadWindow check whether its z-index is less than the z-index of the RadWindow which is currently activated - if so, set a proper, bigger z-index.

For your convenience I prepared a sample script for you, feel free to extend it further in order to meet your needs:

javascript:

 <script type="text/javascript">  
      var active = null;  
      function OnClientShow(sender, args)  
      {  
          active = sender;  
      }  
        
        
       function OnClientActivate(sender, args)  
       {  
           if(active)  
           {  
              var formerZindex = active.get_popupElement().style.zIndex;  
              var currentZindex = sender.get_popupElement().style.zIndex;  
              if(currentZindex < formerZindex)  
              {  
                  sender.get_popupElement().style.zIndex = formerZindex + 10;  
              }  
           }  
           active = sender;  
       }  
    </script>  
 


markup:

  <telerik:RadWindowManager ID="winMngr" runat="server" OnClientShow="OnClientShow" 
            OnClientActivate="OnClientActivate" Behaviors="Close, Maximize, Minimize, Move, Pin, Resize" 
            InitialBehavior="Maximize" ReloadOnShow="true" RestrictionZoneID="tblZone" Skin="Hay" 
            Animation="Slide" ShowContentDuringLoad="false" KeepInScreenBounds="True"

In case you need further assistance or I have misunderstood you, please provide more details about exact scenario and configuration or best - open a new support ticket and send me a sample demo which reproduces the behavior along with detailed reproduction steps and explanations of the actual and the desired behavior.


Greetings,
Svetlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
Ole Albers
Top achievements
Rank 2
Answers by
Svetlina Anati
Telerik team
Ole Albers
Top achievements
Rank 2
Andy
Top achievements
Rank 1
Share this question
or