Getting RadWindows to close

5 posts, 0 answers
  1. Stuart Smith
    Stuart Smith avatar
    2 posts
    Member since:
    Oct 2009

    Posted 12 Oct 2009 Link to this post

    Hello,
    I have a project that uses a pop up RadWindow. The window pops up after the user clicks a button and should stay open until some calculations are made and data entered into the database and the parent page is redirected.  That part works.

    On the parent page however are some asp .net validation controls. If the user make a wrong selection or no selection to some controls I need the pop up window to close so the user can make the required selections. Right now the window just stays open. I can't figure out how to close the pop up window if the user makes a mistake on the parent window.

    Is there anyway to do this or is there an example you can point me to? I guess all I need is for the pop up window to close if some information is missing or worng on the parent page.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 13 Oct 2009 Link to this post

    Hi Stuart,

    Here is the code that I tried to explicitly close the RadWindow from parent page.

    ASPX:
     
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server"
        <Windows> 
            <telerik:RadWindow ID="RadWindow1"  runat="server" OnClientClose="clientClose" VisibleOnPageLoad="true" 
                Behavior="Default" InitialBehavior="None" Left="" NavigateUrl="Window.aspx" Top=""
            </telerik:RadWindow> 
        </Windows> 
    </telerik:RadWindowManager> 

    JavaScript:
     
    <script type="text/javascript"
        function closewin() { 
            var manager = GetRadWindowManager(); 
            var window1 = manager.getWindowByName("RadWindow1"); 
            window1.close(); 
        } 
    </script> 

    -Shinu.
  3. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 14 Oct 2009 Link to this post

    Hi Stuart,

    I am not quite sure if I understand your scenario completely, so if Shinu's reply doesn't help, please open a support ticket and send us a sample project that reproduces your setup and logic and where the problem can be reproduced. We will check it and do our best to help.


    All the best,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  4. Stuart Smith
    Stuart Smith avatar
    2 posts
    Member since:
    Oct 2009

    Posted 14 Oct 2009 Link to this post

    this helped a little bit.

    What I have is a web form that when a button is clicked some information is written to a database. Sometimes the user gets a little inpatient and clicks a couple of times and so serveral entries are made to the database. I created a "Please Wait" window for the user to let them know that the form is working.  However, on the form page, there are some dropdown boxes that are required and I want the "Please Wait" window to close when the user doesn't fill in all the required information.

    I have gotten the window to pop-up when the the button is clicked. That part works great. What doesn't work and waht I can't figure out is to get the "Please Wait" window to close when the required information isn't entered.

    I hope that explains things.
  5. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 16 Oct 2009 Link to this post

    Hi Stuart,

    You could use a custom JavaScript validation that would check if the dropdowns are selected as expected. If they aren't, you could use the code that Shinu provided to close the RadWindow.


    Regards,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top