Modal window over another modal window

10 posts, 0 answers
  1. Dédé
    Dédé avatar
    60 posts
    Member since:
    May 2009

    Posted 16 Jun 2009 Link to this post

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

    Posted 17 Jun 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 17 Jun 2009 Link to this post

    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.
  5. ivantkt
    ivantkt avatar
    14 posts
    Member since:
    Jan 2007

    Posted 28 Jul 2009 Link to this post

    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.

  6. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 30 Jul 2009 Link to this post

    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.
  7. ivantkt
    ivantkt avatar
    14 posts
    Member since:
    Jan 2007

    Posted 30 Jul 2009 Link to this post

    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

     

     

  8. DW Web Team Member
    DW Web Team Member avatar
    43 posts
    Member since:
    Jun 2012

    Posted 04 Aug 2009 Link to this post

    This demo doesn't work if you maximize the first window.  Please advise a solution.
  9. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 06 Aug 2009 Link to this post

    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.
  10. Sreenivas
    Sreenivas avatar
    12 posts
    Member since:
    Dec 2007

    Posted 09 Oct 2012 Link to this post

    Great!. This worked for me. Many thanks.

    Regards
    Sreenivas.
  11. Nick
    Nick avatar
    23 posts
    Member since:
    Jan 2012

    Posted 08 May 2015 in reply to Sreenivas Link to this post

    Thanks a lot, Fiko..

     It worked for me..

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017