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

OnClientClose in RadWindowManager vs RadWindow?

3 Answers 186 Views
Window
This is a migrated thread and some comments may be shown as answers.
DogBizPro
Top achievements
Rank 1
DogBizPro asked on 18 Sep 2013, 01:33 AM
After spending 2 days trying to refresh the parent page when the rad window is closed. I was finally able to get somewhere. If I set the OnClientClose in the RadWindowManager my javascript function fires if I set it in the RadWindow it does not fire. Is this intended? What is the point of the OnClientClose in the RadWindow?

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 18 Sep 2013, 07:28 AM
Hi Stephanie,

Such a behavior is not expected. The OnClientClose event is called after the window is closed. If an argument is passed to the close() method, when it is called from JavaScript you can obtain this object via the get_argument() method of the event arguments object. Useful in dialog scenarios when closing the RadWindow from its content page. Please check the sample code I tried to invoke OnClientClose from RadWindowManager as well as from RadWindow. Also note that if you are attaching OnClientClose to RadWindowManager and a RadWindow inside the WindowManager, then the event attached to the corresponding RadWindow will be called on closing that particular RadWindow.

ASPX:
<telerik:RadWindowManager ID="RadWindowManager1" OnClientClose="OnClientClose" runat="server"
    Width="400px" Height="400px">
    <Windows>
        <telerik:RadWindow ID="RadWindow1" runat="server">
        </telerik:RadWindow>
        <telerik:RadWindow ID="RadWindow2" runat="server" OnClientClose="OnClientClose1">
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>
<telerik:RadButton runat="server" AutoPostBack="false" Text="Open RadWindow1" OnClientClicked="openRadWindow1">
</telerik:RadButton>
<telerik:RadButton runat="server" AutoPostBack="false" Text="Open RadWindow2" OnClientClicked="openRadWindow2">
</telerik:RadButton>

JavaScript:
<script type="text/javascript">
    function OnClientClose() {
        alert("Called from RadWindowManager");
    }
    function OnClientClose1() {
        alert("Called from RadWindow");
    }
    function openRadWindow1() {
        $find('<%=RadWindow1.ClientID %>').show();
    }
    function openRadWindow2() {
        $find('<%=RadWindow2.ClientID %>').show();
    }
</script>

Thanks,
Shinu.
0
DogBizPro
Top achievements
Rank 1
answered on 18 Sep 2013, 12:44 PM
Well the OnClientClose is only called when I have that in the RadWindowManager tag. When I move it to the RadWindow tag it is not called and that is the only thing I change....Seems like a bug somewhere....
0
Shinu
Top achievements
Rank 2
answered on 19 Sep 2013, 05:04 AM
Hi Stephanie,

Unfortunately I couldn't replicate this issue at my end and the code I posted works fine at my end. Are you able to replicate the unusual behavior with my code? Can you please post the code you tried so that I can investigate more into this issue?

Thanks,
Shinu.
Tags
Window
Asked by
DogBizPro
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
DogBizPro
Top achievements
Rank 1
Share this question
or