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

Modal window over another modal window

9 Answers 712 Views
Window
This is a migrated thread and some comments may be shown as answers.
Dédé
Top achievements
Rank 1
Dédé asked on 16 Jun 2009, 02:47 PM
Hi,

I would like to show a modal window over another modal window.

I first tried to apply this doc but second window is not modal from first.

Can you add a "multi-modal window" behavior ? When second is shown as modal from first window, first widows is hidden (not closed) and when second window is close, first window is shown (and not reloaded as if "opened").

Thanks.

9 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 17 Jun 2009, 06:55 AM
Hello Damien,

Here is the code that I tried to show modal window over another modal window. Give a try with this.

Parent Page (Default.aspx):
aspx:
 
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">  
    <Windows> 
        <telerik:RadWindow Modal="true" Width="600" Height="450" runat="server" ID="Win1" 
            NavigateUrl="win1.aspx" OpenerElementID="Button1">  
        </telerik:RadWindow> 
    </Windows> 
</telerik:RadWindowManager> 
<input id="Button1" type="button" value="Oepn Window"/> 

Page opened in RadWindow1 (win1.aspx) :
aspx:
 
<input id="Button3" type="button" value="Open another window" onclick="openwin();" /> 

javascript:
 
<script type="text/javascript">  
function openwin()  
{  
    var oBrowserWnd = GetRadWindow().BrowserWindow;  
    var oWnd = oBrowserWnd.radopen("win2.aspx""NewWindow");  
    oWnd.set_modal(true);  
}  
</script> 

Thanks,
Princy.
0
Fiko
Telerik team
answered on 17 Jun 2009, 10:52 AM
Hello Damien,

Yes this scenario is possible, but you need to call the set_modal() function of the second RadWindow after some timeout :
function openPopup() 
    var oWindow = GetRadWindow(); 
    var newWindow = oWindow.BrowserWindow.radopen('http://www.telerik.com''RadWindowB'); 
    setTimeout 
    ( 
        function() 
        { 
            newWindow.set_modal(true); 
        }, 
    0); 

As you can see the zero duration does the trick as the well. For your convenience I have attached a full demo to the thread.

I hope this helps.


Kind regards,
Fiko
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
ivantkt
Top achievements
Rank 1
answered on 28 Jul 2009, 05:43 PM
Hello i have the same problem, i used the files in Attached modalfrommodal.zip, and there still a  problem when you do the next steps:
  1. Run the application
  2. Click on the button "Show radWindow 1", this open the firts window
  3. Maximaze the firts window (radWindow 1 = PopUp1.aspx)
  4. Click on the button "Show radWindow 2", this open the second window behind the first

It looks like the problem appears when a window is "Maximazed"

I really need to solve this issue its urgent, any idea?

Thanks in advance for your reply.

0
Fiko
Telerik team
answered on 30 Jul 2009, 10:15 AM
Hello ivantkt,

This scenario is not supported by the RadWindow control, because the modal and the maximized RadWindow is expected to be on the top of all the elements on the page. However, it can be achieved using the RadWindow's client-side API. For your convenience, I prepared a sample project that demonstrates how to implement the desired functionality. The idea is, when the second window is shown and the first one is maximized - you simply restore the first one; then in the OnClientClose event handler of the second window you maximize the first window.
I also included detailed comments in the source code that I believe will be of much help to you.

Please do not hesitate to contact us if you have any questions.

Best wishes,
Fiko
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
ivantkt
Top achievements
Rank 1
answered on 30 Jul 2009, 04:54 PM

Thank you very much Fiko, the solution was great and works perfectly.

I was trying with the methods setActive() and set_modal() of the window but they didn't work, the one that help me, was the
restore() method.


I did the following

 

  1. Every time I open a window I check if it's maximazed, if it's true, I restored them

    var oManager = GetRadWindowManager(); 
    var activeWindow = oManager.GetActiveWindow(); // Get reference to the active RadWindow; 
    
if(activeWindow != null && activeWindow.isMaximized())

    {
activeWindow.restore();
maximazeActiveWindow =

true;
}
var newWindow = window.radopen(url, '');

2.  When I come back to the first window I did the following
var oManager = GetRadWindowManager();
var activeWindow = oManager.GetActiveWindow(); // Get reference to the active RadWindow;
if(maximazeActiveWindow)
{
oWnd.maximize();
maximazeActiveWindow = false;
}

Thanks,
Ivan

 

 

0
DW Web Team Member
Top achievements
Rank 2
answered on 04 Aug 2009, 09:05 PM
This demo doesn't work if you maximize the first window.  Please advise a solution.
0
Fiko
Telerik team
answered on 06 Aug 2009, 11:00 AM
Hello,

I have already answered your question in this forum thread.

Best wishes,
Fiko
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
Sreenivas
Top achievements
Rank 1
answered on 09 Oct 2012, 09:36 PM
Great!. This worked for me. Many thanks.

Regards
Sreenivas.
0
Nick
Top achievements
Rank 1
answered on 08 May 2015, 08:29 PM

Thanks a lot, Fiko..

 It worked for me..

Tags
Window
Asked by
Dédé
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Fiko
Telerik team
ivantkt
Top achievements
Rank 1
DW Web Team Member
Top achievements
Rank 2
Sreenivas
Top achievements
Rank 1
Nick
Top achievements
Rank 1
Share this question
or