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

Error on trying to close a RadWindow

2 Answers 122 Views
Window
This is a migrated thread and some comments may be shown as answers.
Zoe
Top achievements
Rank 1
Zoe asked on 18 Apr 2019, 08:45 PM

When I have multiple ASP.NET validators on a page, I can't close a RadWindow that has an animation using my usual client-side javascript function. When I comment out the validators until there's just one left or disable the animation, suddenly it works perfectly again. I even tried using NavigateURL and moving all my markup to a separate page instead of using ContentTemplate and the window still wouldn't close until I either disabled animation or commented out validators until one was left.

I was able to recreate this in a fresh web site in VS2012 Pro, although another pre-existing project (different than the one I first discovered this error on) has multiple validators on one page and yet is fine. I also tried a few different versions ranging from the most recent, 2019.1.215.45, back to 2015.2.826.45.  This leads me to believe there is something else that is a factor here, as I doubt I'm the only person to have tried to close a RadWindow under these circumstances since 2015.

Fortunately this error can be resolved for now by simply disabling animations on my RadWindows in that project, but I would like to be able to re-enable them at some point.

This is my code (no code-behind used):

01.<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Test1.aspx.vb" Inherits="Test1" %>
02.<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
03. 
04.<!DOCTYPE html>
05. 
07.<head id="Head1" runat="server">
08.    <title>Test1</title>
09.</head>
10.<body>
11.    <form id="form1" runat="server">
12.    <div>
13.        <telerik:RadScriptManager runat="server" ID="rsm1">
14.        </telerik:RadScriptManager>
15.        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
16.            <script type="text/javascript">
17. 
18.                function openWindow(sender, args) {
19.                    $find("<%= window.ClientID%>").show();
20.                }
21.                function closeWindow(sender, args) {
22.                    try {
23.                        $find("<%= window.ClientID%>").close();
24.                    } catch (e) {
25.                        alert(e);
26.                        console.log(e);
27.                    }
28.                }
29.            </script>
30.        </telerik:RadScriptBlock>
31.        <telerik:RadWindow runat="server" ID="window" RenderMode="Lightweight" Skin="Material" Modal="true" Animation="Fade" VisibleStatusbar="false"  KeepInScreenBounds="true" Height="125px" Width="300px" Title="Click Cancel" Behaviors="None">
32.            <ContentTemplate>
33.                <telerik:RadPageLayout ID="layout" runat="server" GridType="Fluid" Height="100%">
34.                    <telerik:LayoutRow style="padding-top:3px;">
35.                        <Columns>
36.                            <telerik:LayoutColumn Span="8">
37.                                <telerik:RadButton runat="server" style="float:right;" RenderMode="Lightweight" Skin="Material" ID="cancelBtn" CssClass="rbFlatButton" Primary="false" Text="Cancel" AutoPostBack="false" OnClientClicked="closeWindow" />
38.                            </telerik:LayoutColumn>
39.                            <telerik:LayoutColumn Span="4">
40.                                <telerik:RadButton runat="server" RenderMode="Lightweight" Skin="Material" ID="okayBtn" CssClass="rbFlatButton" Primary="true" Text="Okay"/>
41.                            </telerik:LayoutColumn>
42.                        </Columns>
43.                    </telerik:LayoutRow>
44.                </telerik:RadPageLayout>
45.            </ContentTemplate>
46.        </telerik:RadWindow>
47.        <telerik:RadTextBox runat="server" ID="text" RenderMode="Lightweight" Skin="Material" />
48.        <asp:RequiredFieldValidator runat="server" ID="val" ControlToValidate="text" ErrorMessage="Required!" />
49.        <telerik:RadTextBox runat="server" ID="text2" RenderMode="Lightweight" Skin="Material" />
50.        <asp:RequiredFieldValidator runat="server" ID="val2" ControlToValidate="text2" ErrorMessage="Required!" />
51.        <telerik:RadButton runat="server" Text="Open Window" Enabled="true" RenderMode="Lightweight" ButtonType="StandardButton" ID="openBtn" Skin="Material" AutoPostBack="false" CausesValidation="false" OnClientClicked="openWindow" />
52.    </div>
53.    </form>
54.</body>
55.</html>

And this is the error I got on opening the window and clicking cancel:

TypeError: $telerik.$(...).stopTransition is not a function
    at c.RadWindow._hide (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=rsm1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a48bbf511-5bf9-4491-9be4-5464dcf4e3ba%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2019.1.215.45%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a05294e6d-c3f5-4495-92ed-e871448550ca%3a4877f69a%3a16e4e7cd%3af7645509%3a24ee1bba%3ab2e06756%3a92fe8ea0%3ac128760b%3a19620875%3a874f8ea2%3afa31b949%3af46195d3%3a33715776%3a490a9d4e%3a6d43f6d9%3ab7778d6c:formatted:21454)
    at c.RadWindow.hide (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=rsm1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a48bbf511-5bf9-4491-9be4-5464dcf4e3ba%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2019.1.215.45%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a05294e6d-c3f5-4495-92ed-e871448550ca%3a4877f69a%3a16e4e7cd%3af7645509%3a24ee1bba%3ab2e06756%3a92fe8ea0%3ac128760b%3a19620875%3a874f8ea2%3afa31b949%3af46195d3%3a33715776%3a490a9d4e%3a6d43f6d9%3ab7778d6c:formatted:21314)
    at c.RadWindow.close (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=rsm1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a48bbf511-5bf9-4491-9be4-5464dcf4e3ba%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2019.1.215.45%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a05294e6d-c3f5-4495-92ed-e871448550ca%3a4877f69a%3a16e4e7cd%3af7645509%3a24ee1bba%3ab2e06756%3a92fe8ea0%3ac128760b%3a19620875%3a874f8ea2%3afa31b949%3af46195d3%3a33715776%3a490a9d4e%3a6d43f6d9%3ab7778d6c:formatted:22597)
    at Array.closeWindow (Test1.aspx:76)
    at Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=rsm1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a48bbf511-5bf9-4491-9be4-5464dcf4e3ba%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2019.1.215.45%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a05294e6d-c3f5-4495-92ed-e871448550ca%3a4877f69a%3a16e4e7cd%3af7645509%3a24ee1bba%3ab2e06756%3a92fe8ea0%3ac128760b%3a19620875%3a874f8ea2%3afa31b949%3af46195d3%3a33715776%3a490a9d4e%3a6d43f6d9%3ab7778d6c:formatted:2556
    at b.RadButton.raiseEvent (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=rsm1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a48bbf511-5bf9-4491-9be4-5464dcf4e3ba%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2019.1.215.45%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a05294e6d-c3f5-4495-92ed-e871448550ca%3a4877f69a%3a16e4e7cd%3af7645509%3a24ee1bba%3ab2e06756%3a92fe8ea0%3ac128760b%3a19620875%3a874f8ea2%3afa31b949%3af46195d3%3a33715776%3a490a9d4e%3a6d43f6d9%3ab7778d6c:formatted:8930)
    at g._clickedHandler (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=rsm1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a48bbf511-5bf9-4491-9be4-5464dcf4e3ba%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2019.1.215.45%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a05294e6d-c3f5-4495-92ed-e871448550ca%3a4877f69a%3a16e4e7cd%3af7645509%3a24ee1bba%3ab2e06756%3a92fe8ea0%3ac128760b%3a19620875%3a874f8ea2%3afa31b949%3af46195d3%3a33715776%3a490a9d4e%3a6d43f6d9%3ab7778d6c:formatted:28089)
    at b.BaseFunctionality.trigger (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=rsm1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a48bbf511-5bf9-4491-9be4-5464dcf4e3ba%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2019.1.215.45%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a05294e6d-c3f5-4495-92ed-e871448550ca%3a4877f69a%3a16e4e7cd%3af7645509%3a24ee1bba%3ab2e06756%3a92fe8ea0%3ac128760b%3a19620875%3a874f8ea2%3afa31b949%3af46195d3%3a33715776%3a490a9d4e%3a6d43f6d9%3ab7778d6c:formatted:15055)
    at b.BaseFunctionality.clicked (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=rsm1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a48bbf511-5bf9-4491-9be4-5464dcf4e3ba%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2019.1.215.45%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a05294e6d-c3f5-4495-92ed-e871448550ca%3a4877f69a%3a16e4e7cd%3af7645509%3a24ee1bba%3ab2e06756%3a92fe8ea0%3ac128760b%3a19620875%3a874f8ea2%3afa31b949%3af46195d3%3a33715776%3a490a9d4e%3a6d43f6d9%3ab7778d6c:formatted:27039)
    at b.PlainFunctionality.clicked (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=rsm1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a48bbf511-5bf9-4491-9be4-5464dcf4e3ba%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2019.1.215.45%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a05294e6d-c3f5-4495-92ed-e871448550ca%3a4877f69a%3a16e4e7cd%3af7645509%3a24ee1bba%3ab2e06756%3a92fe8ea0%3ac128760b%3a19620875%3a874f8ea2%3afa31b949%3af46195d3%3a33715776%3a490a9d4e%3a6d43f6d9%3ab7778d6c:formatted:26896)

Following the above stack trace, I went in to the _hide function and found the line (line 11 below) where the error was occurring, which was how I figured the animation was part of the issue:

01._hide: function() {
02.    if (!this.get_animation() || this.get_animation() == 0) {
03.        this._afterHide();
04.    } else {
05.        if (this._enableShadow && $telerik.isIE) {
06.            this._setShadowCSSClass(false);
07.        }
08.        var n = Function.createDelegate(this, this._afterHide)
09.          , o = this.isMaximized()
10.          , m = this.get_animationDuration();
11.        $telerik.$(this._popupElement).stopTransition().transition({
12.            opacity: 0
13.        }, m, "linear", function() {
14.            n(o);
15.        });
16.    }
17.}



2 Answers, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 23 Apr 2019, 06:01 PM
Hi Zoe,

As per your assumption, the faced problem is related to a combination of the used unobtrusive validation and the enabled animation of RadWindow. We used to have a similar bug in the past but it seems the the issue is brought back in the latest release, so I will pass it to our developers for a further investigation.

Unfortunately, the only workaround for this behavior for the moment is the one that you have already found on your own - to disable the animation of RadWindow.

Regards,
Vessy
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Sullivan
Top achievements
Rank 1
answered on 02 May 2019, 11:16 AM
Are you trying to close the RadWindow from inside the window or from the page that launches. This should work if I have made a mistake please correct me.
Tags
Window
Asked by
Zoe
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Sullivan
Top achievements
Rank 1
Share this question
or