RadWindow OnClientClose not working

6 posts, 0 answers
  1. Baris
    Baris avatar
    5 posts
    Member since:
    May 2011

    Posted 20 May 2011 Link to this post

    I am using radwindowmanager on my master page and my other aspx pages are showing radwindows using this manager. except one aspx page, everything is working as expected. on this problematic page i have nothing different, I have the radwindow shown but the bloody OnClientClose event is not working! On other pages when i delete the OnClientClose function on javascript code, it gives me the event is not defined error as normal. but on the problematic page when i delete the OnClientClose, it doesnt even give an error. 

    function confirm(text) {
                 var oManager = GetRadWindowManager();
                 var oWnd = oManager.open(null, "RadWindow6");
                 oWnd.SetTitle(text);
             }

    <telerik:RadWindow ID="RadWindow6" runat="server" Animation="None" Behavior="Default"
                    Height="170px"
                    InitialBehavior="None" Left="" Modal="True" NavigateUrl="~/popups/ConfirmWindow.aspx" OnClientClose="OnClientClose"
                    Overlay="True" Top="" VisibleStatusbar="False" Width="360px" Skin="WebBlue" Behaviors="Move,Close" >
                </telerik:RadWindow>

    and here's the script that is added to a close button on the ConfirmWindow.aspx page which is inside this radwindow (works and closes the window as expected) :

    function CloseWindow(type) {
            var oWnd = GetRadWindow();
            var oArg = new Object();
            oArg.result = false;
            oArg.type = type;
            oWnd.close(oArg);
        }



    the javascript func is opening radwindow and my close button is closing the window but OnClientClose is not working, not even seeked! What am I missing?
  2. Gimmik
    Gimmik avatar
    170 posts
    Member since:
    May 2011

    Posted 20 May 2011 Link to this post

    Do you have a javascript function called "OnClientClosed"? Does it get fired?

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Baris
    Baris avatar
    5 posts
    Member since:
    May 2011

    Posted 20 May 2011 Link to this post

    yes I have : "but on the problematic page when i delete the OnClientClose function, it doesnt even give an error. " which means my radwindow doesnt seek an OnClientClose function when it is closed on that specific aspx page. it works and fires the function on other pages. I must be missing sth.. I am desperately examining the code line by line but it looks same as my other aspx pages.

    btw Gimmik, the topic is only about my OnClientClose function not firing and you're asking me if its firing.interesting =)
  5. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 24 May 2011 Link to this post

    Hi guys,

    To be fair, a function that is not working and a function that is not fired at all are 2 different scenarios in many cases :)

    Anyway, when you say that the function is not working, I assume that even if you add a standard alert in that function, it is not fired at all, is that so? If yes, you most probably have a second RadWindowManager on that page. In such case, you need to take into consideration the following:

       1. All RadWindowManager's functions (radopen, radalert, radconfirm, radprompt, GetRadWindowManager, etc) are always using the first rendered RadWindowManager on the page.
       2. Every RadWindowManager "knows" only the RadWindows that are declared in its Windows collection.

    This means that if you have a RadWindow2 as a standalone control OR declared in RadWindowManager2, and you use something like radopen(myUrl, "RadWindow2");, radopen will use RadWindowManager1 and will open a new RadWindow with the settings taken from RadWindowManager1.
    To avoid that problem, when you have multiple managers on a page, you need to get a reference to the correct RadWindowManager first and then call its methods.
    e.g.
    var manager = $find("<%= RadWindowManager2.ClientID %>");
    manager.open(myUrl, "RadWindow2");   


    I hope this information helps. If it doesn't, please open a support ticket and send me the code for the masterpage and the problematic content one, so I could check them.


    Greetings,
    Georgi Tunev
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  6. Baris
    Baris avatar
    5 posts
    Member since:
    May 2011

    Posted 25 May 2011 Link to this post

    I found the problem and second radwindowmanager wasnt the cause as I dont have a second.
    Here I draw a picture of my scenario (this new paint is funny =) ) http://img189.imageshack.us/img189/3250/unledqze.png

    my aspx and ascx were both implementing OnClientClose functions but the problematic page was my aspx. I found out that the radwindow on my aspx was triggering the OnClientClose func on ascx as I am using the same RadWindow on both pages.

    I feel stupid not to think of this before.. 
  7. Salik
    Salik avatar
    1 posts
    Member since:
    Jul 2015

    Posted 31 Jul 2015 in reply to Georgi Tunev Link to this post

    Thank You (y) first point helped Me
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017