Close parent window from child RadWindow

5 posts, 1 answers
  1. Kaushal
    Kaushal avatar
    35 posts
    Member since:
    Oct 2010

    Posted 30 Nov 2010 Link to this post

    Hi ALL,

              I have one main page, main page have one button, on click of button i had open one RadWindow which have Add Operation,while user enter required information and try to click on Add button i had open third Child RadWindow for indicating progress, once progress will complete Progress and Add Window will close.

    MainPage -> Click On Button -> Add Form -> Click On Save -> Progress Window Open -> Process Complete- > Progress and Add Form closed.

             Now what i want, when user click on Main Page Button child window will populate, once all information enter to Add Form user try to save it, once user click on save button progress window will get display from Add Form, here i need to close Add Form when progress popup will get display....

    MainPage -> Click On Button -> Add Form -> Click On Save -> Progress Window Open -> Close Add Form->Process Complete- > Progress Window closed.

    Please do me help to achieve this kind of functionality.

    Thanks
    Kaushal.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 01 Dec 2010 Link to this post

    Hello Kaushal,


    You can use the current RadWindow's (AddForm) parent window (Main page) as the parent of the new window (Progress window). And close the AddForm window using client code while opening the Progress window.

    Here is the documentation which shows how to open window which is not linked to the intermediate window.
    Opening a RadWindow from Within a RadWindow

    For closing window, the code shown in the documentation will help.
    Using RadWindow as a Dialog


    -Shinu.
  3. Kaushal
    Kaushal avatar
    35 posts
    Member since:
    Oct 2010

    Posted 01 Dec 2010 Link to this post

    Hi Shinu,

        Thanks for your reply, i gone through your refrence link, but it may be not usefull to me, let me explain clearly what i need.

    All pages has been developed now i want to manage open-close sequence of each Parent-Child page..

    I have total three pages...

    Main.aspx

    Child.aspx

    Process.aspx

    Current Scanario
     
                Main.aspx (Have button to open child page)

                        Chilc.aspx (User will come on this page while click on main page button, this page have save button, when user click on save button Process page get display)

                                 Process.aspx(Processing, once process completed Process.aspx and Child.aspx get closed and user will redirect to Main.aspx)

    Required Scanario
     
                Main.aspx (Have button to open child page)

                        Chilc.aspx (User will come on this page while click on main page button, this page have save button, when user click on save button Process page get display)

                                 Process.aspx(Child.aspx should be close,Processing, once process completed Process.aspx get closed and user will redirect to Main.aspx)

    Is this possible?

    All the pages are related to his parent page and open from his parent page...

    Like Process.aspx page will get open from Child.aspx and Child.aspx will get open from Main.aspx.
  4. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 02 Dec 2010 Link to this post

    Hello Kaushal,


    I am sharing the code in detail. Hope this works for you.


    In main page -  code for opening Child.aspx:
            <telerik:RadWindowManager ID="RadWindowManager1" runat="server" />
            <input id="Button1" type="button" value="openChild" onclick="openWindow();" />
     
    <script type="text/javascript">
        function openWindow() {
            var radWin = window.radopen("../Child/Child.aspx");
        }
    </script>


    In the Child page, where you want to open another window which is Progress.aspx:
            Child.aspx
            <input id="Button1" type="button" value="Save" onclick="openProcess();" />
     
     
    <script type="text/javascript">
        function openProcess() {
            var oManager = GetRadWindow().get_windowManager(); // Get the windowmanager on main page
            oManager.open("../Child/Process.aspx", "NewWindow");
        }
        function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow)
                oWindow = window.radWindow;
            else if (window.frameElement.radWindow)
                oWindow = window.frameElement.radWindow;
            return oWindow;
        
    </script>
    You can write the logic to close this window as soon as the operation completes (Call GetRadWindow().close() to close the window).

    Now in Progress.aspx page:
           Process.aspx
            <input id="Button1" type="button" value="Close" onclick="openProcess();" />
     
     
    <script type="text/javascript">
        function openProcess() {
            GetRadWindow().close(); // To close the window on button click
        }
        function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow)
                oWindow = window.radWindow;
            else if (window.frameElement.radWindow)
                oWindow = window.frameElement.radWindow;
            return oWindow;
        
    </script>





    -Shinu.
  5. Kaushal
    Kaushal avatar
    35 posts
    Member since:
    Oct 2010

    Posted 03 Dec 2010 Link to this post

    Hi Shinu,

             Thanks a lot to shared your code to me, according to your code its seems to working fine.

            
    Thanks
Back to Top