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

2009Q1 hide() not fired OnClientClose event?

4 Answers 62 Views
Window
This is a migrated thread and some comments may be shown as answers.
edjia
Top achievements
Rank 1
edjia asked on 29 Apr 2009, 06:16 AM
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

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 29 Apr 2009, 07:14 AM
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
0
edjia
Top achievements
Rank 1
answered on 29 Apr 2009, 07:23 AM
the close method  test is ok before i post this thread.
but i want to know why 2008q2 is ok 
 and 2009q1 is wrong.
0
Fiko
Telerik team
answered on 30 Apr 2009, 03:05 PM
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.
0
edjia
Top achievements
Rank 1
answered on 03 May 2009, 05:27 AM
thank you very much!
Tags
Window
Asked by
edjia
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
edjia
Top achievements
Rank 1
Fiko
Telerik team
Share this question
or