RadWindow Error Closing

7 posts, 0 answers
  1. Keith Lusk
    Keith Lusk avatar
    4 posts
    Member since:
    Sep 2009

    Posted 16 Jun 2010 Link to this post

    The following does not work:

    function

     

     

    CloseOnReload() {

     

    GetRadWindow().Close();

    }

     

     

    function GetRadWindow() {

     

     

     

    var oWindow = null;

     

     

     

    if (window.radWindow) oWindow = window.radWindow;

     

     

     

    else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;

     

     

     

    return oWindow;

     

    }



    This is called by a CloseOnReload() script registered as a startup script when some action is performed.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 17 Jun 2010 Link to this post

    Hi,

    The code should be executed in the radwindow page as described in the documentation here.
    Executing Script on a Reload

         If you want to close the window from parent page, then you need to access the window client object and invoke the close() method. Get the client object of window by using 'getWindowByName' method.


    -Shinu.
  3. Keith Lusk
    Keith Lusk avatar
    4 posts
    Member since:
    Sep 2009

    Posted 17 Jun 2010 Link to this post

    Hi,

    First, thank you so much for your response. The radwindow is contained by the radwindow manager. I had to set

    PreserveClientState

     

     

    ="true" on the manager in order to keep the window open when posting information from the window back to the server. The window is not accessing a separate page url, but is using a content template. When the done button (linkbutton) is clicked in the radwindow, if the page is valid, then I register the startup script to close the window. I have found that in the window show javascript function GetRadWindowManager() returns a reference to the radwindowmanager, but in the CloseOnReload, GetRadWindowManager returns null.

    The getWindowByName or getWindowByID methods of the radwindowmanager will not work until I can get a reference to the RadWindowManager. I have looked at the source of the page  and have found the client ID of the radwindow manager = <div id="ctl00_ContentPlaceHolder1_contolPanel_ctl00_ctl01_rgLinkList_ctl00_ctl02_ctl03_gceGenericContent_rwmManager" style="display:none;"> and the client id of the radwindow(there is only one): <div id="ctl00_ContentPlaceHolder1_contolPanel_ctl00_ctl01_rgLinkList_ctl00_ctl02_ctl03_gceGenericContent_rwContentEditor" style="display:none;">.

    The id of each is rwmManager and rwContentEditor. Why would GetRadWindowManager() not return the manager reference? Is there some other method that should be used in the Javascript?

    Thanks
    Keith

  4. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 18 Jun 2010 Link to this post

    Hi Keith,

    The GetRadWindow() function is used to reference a RadWindow from inside its content page. In your case, however, the RadWindow and its content are all on the same page - that is why you should simply reference it as you reference a client object on the same page - by using the $find method.


    Best wishes,
    Svetlina
    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
  5. Keith Lusk
    Keith Lusk avatar
    4 posts
    Member since:
    Sep 2009

    Posted 18 Jun 2010 Link to this post

    Hi Svetlina,

    Thank you for the reply. That suggestion did not work. On the debug of the javascript for the CloseOnReload function, the following $finds:

    var

     

     

    oManager = $find("<%= rwmManager.ClientID %>");
    oManager.closeall();
    var oWnd = $find("<%= rwContentEditor.ClientID %>");

     

    oWnd.close();

    Both returned null references. Neither the Manager nor the Window could be found.

    If I do a search on the source control for each -> The Manager:
    <div id="ctl00_ContentPlaceHolder1_contolPanel_ctl00_ctl01_rgLinkList_ctl00_ctl02_ctl03_gceGenericContent_rwmManager" style="display:none;">
    And the window:
    <div id="ctl00_ContentPlaceHolder1_contolPanel_ctl00_ctl01_rgLinkList_ctl00_ctl02_ctl03_gceGenericContent_rwContentEditor" style="display:none;">

    Are both on the page.

    Thanks
    Keith

  6. Keith Lusk
    Keith Lusk avatar
    4 posts
    Member since:
    Sep 2009

    Posted 22 Jun 2010 Link to this post

    As previously stated, I still cannot get this window to close. See above
  7. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 24 Jun 2010 Link to this post

    Hello Keith,

    In such case, please open a support ticket and send us a small sample project / sample page(s) where this issue could be reproduced. This way we will get a better view over your exact setup and logic and we will provide you with a solution right away.

    Thank you in advance for your cooperation.

    Greetings,
    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
Back to Top