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

Getting RadWindows to close

4 Answers 85 Views
Window
This is a migrated thread and some comments may be shown as answers.
Stuart Smith
Top achievements
Rank 1
Stuart Smith asked on 12 Oct 2009, 05:07 PM
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.

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 13 Oct 2009, 09:32 AM
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.
0
Georgi Tunev
Telerik team
answered on 14 Oct 2009, 08:31 AM
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.
0
Stuart Smith
Top achievements
Rank 1
answered on 14 Oct 2009, 01:40 PM
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.
0
Georgi Tunev
Telerik team
answered on 16 Oct 2009, 11:08 AM
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.
Tags
Window
Asked by
Stuart Smith
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Georgi Tunev
Telerik team
Stuart Smith
Top achievements
Rank 1
Share this question
or