RadWindow ClientClose event failing

3 posts, 0 answers
  1. Richard
    Richard avatar
    8 posts
    Member since:
    Aug 2010

    Posted 29 Sep 2010 Link to this post


    (Related to previous post, but information there not needed for this query)
    I have a form with a RadWindow that pops up on Submit.  All the code within the RadWindow performs properly, but I need it to refresh the page behind on close.  I have this code:

    RadWindowManager1.OnClientClose = "FuncName";
    which generates this in the client:
    in the Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadWindowManager, [stuff snipped here] {"close":FuncName} [more stuff]
    so does appear to be doing what it should within the RadWindow

    However, on closing my RadWindow, FuncName is not called at all (tested with alerts and debugger calls).
    Any idea why?

    (Previous problem was caused by the FuncName function not being in scope at the time of the $create call, this is fixed now, so can't see any reason this should be failing)

  2. Georgi Tunev
    Georgi Tunev avatar
    7207 posts

    Posted 30 Sep 2010 Link to this post

    Hi Richard,

    If a FuncName() JavaScript function exists in the page where the RadWindowManager is, it should be called when a RadWinow (created via that same RadWindowManager) is closed.

    A problem like the one you describe, can occur if you have more than 1 RadWindowManager on the 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 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.
    var manager = $find("<%= RadWindowManager2.ClientID %>");
    manager.open(myUrl, "RadWindow2");

    I hope this helps. If you still experience problems, please open a support ticket and send a sample project where the behavior can be reproduced. This blog post can help you isolate the problem.

    All the best,
    Georgi Tunev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Richard
    Richard avatar
    8 posts
    Member since:
    Aug 2010

    Posted 30 Sep 2010 Link to this post

    Thanks for the reply.

    There is indeed a FuncName() function on the page, FuncName(argument) in fact in order to fit the format of the call from the event.
    If there isn't, you get a JS error on pageload of the containing page, when it tries to register the event.

    I found the second RadWindowManager (hiding on the Master Page) I got rid of it, and now it's happy, thank you.

    (well, when I say happy, the RadAjaxManager is now failing, but hey, a new thing for me to investigate :) )
Back to Top