2009Q1 hide() not fired OnClientClose event?

5 posts, 0 answers
  1. edjia
    edjia avatar
    6 posts
    Member since:
    Feb 2008

    Posted 29 Apr 2009 Link to this post

    today, i'm upgrade from 2008 q2 to 2009 q1,unfortunately, onclickentClose event not fired when call hide method
    it's a bug ? or a design?
    help me plz
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 29 Apr 2009 Link to this post

    Hi Edjia,

    The hide() method makes the window invisible. I guess using close() method is better option for you because the window will be clossed and the OnClientClose() event will fire on executing close() method.

    Here is the example which I tried.
    .aspx
     
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">  
        <Windows> 
            <telerik:RadWindow ID="RadWindow1" OnClientClose="OnClientClose" NavigateUrl="Dialog1.aspx" runat="server" VisibleOnPageLoad="true">  
            </telerik:RadWindow>              
        </Windows>          
    </telerik:RadWindowManager> 
    <input id="Button1" type="button" value="hide" onclick="closeWindow();" /> 

    .javascript
     
    <script type="text/javascript">  
    function closeWindow()  
    {  
        var oManager = GetRadWindowManager();  
        var window1 = oManager.getWindowByName("RadWindow1");  
        window1.close();  
    }  
    function OnClientClose()  
    {  
        alert('OnClientClose fired');  
    }  
    </script> 
    Check-out the following link for important client side methods of RadWindow.
    RadWindow Methods

    -Princy
  3. edjia
    edjia avatar
    6 posts
    Member since:
    Feb 2008

    Posted 29 Apr 2009 Link to this post

    the close method  test is ok before i post this thread.
    but i want to know why 2008q2 is ok 
     and 2009q1 is wrong.
  4. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 30 Apr 2009 Link to this post

    Hi Edjia,

    Indeed, such behavior existed in previous version of the control but we changed that. Now OnClientClose is fired only when the window is closed.

    Note that in case the DestroyOnClose property has value "false" (by default it is "false"), you can use the close() RadWindow's client side function instead of the hide() one. In this case both functions do the same thing.

    All the best,
    Fiko
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. edjia
    edjia avatar
    6 posts
    Member since:
    Feb 2008

    Posted 03 May 2009 Link to this post

    thank you very much!
Back to Top