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

Issue with RadWindow (2014.2.618.45)

2 Answers 30 Views
Window
This is a migrated thread and some comments may be shown as answers.
Sean
Top achievements
Rank 1
Sean asked on 24 Jun 2014, 05:19 AM
Have a couple of RadWindows on a product I developed a couple of years ago.  No code has changed only updated to the latest Telerik to add some other functionality, and now the RadWindows do not autosize, the native radwindow close doesn't close and when attempt to close them via a button, I am now getting the following error:

0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'stopTransition'

The following is code that creates the RadWindow server side, and then adds it to RadWindowManager.  This code has not changed.

HTML:
<telerik:RadWindowManager ID="rwmViewPackage" runat="server" Animation="Fade"
EnableShadow="True" KeepInScreenBounds="True" Modal="True" Skin="Metro" Behaviors="Close"
VisibleOnPageLoad="True" VisibleStatusbar="False" DestroyOnClose="True"
EnableViewState="false" AutoSize="True" >
</telerik:RadWindowManager>

VB.NET:
Dim rwViewPackage As New Telerik.Web.UI.RadWindow
rwViewPackage.NavigateUrl = "~/vpAdditions/Comments.aspx"
rwViewPackage.Title = "Comments for "
rwViewPackage.Title = rwViewPackage.Title & tbManufacturer.Text & " " & tbName.Text
rwViewPackage.ID = "rwViewPackage"
rwViewPackage.Animation = Telerik.Web.UI.WindowAnimation.Fade
rwViewPackage.EnableViewState = False
rwViewPackage.EnableShadow = True
rwViewPackage.DestroyOnClose = True
rwViewPackage.VisibleOnPageLoad = True
rwViewPackage.KeepInScreenBounds = True
rwViewPackage.Modal = True
rwViewPackage.Skin = "Default"
rwViewPackage.IconUrl = "../Graphics/Package/PreviousComments.png"
rwViewPackage.AutoSize = True
rwmViewPackage.Windows.Add(rwViewPackage)

The Comments.aspx contains the following code to close:
HTML:
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function CloseAndRebind() {
GetRadWindow().BrowserWindow.refreshGrid();
setTimeout(function () {
GetRadWindow().close();
}, 0);
}
function GetRadWindow() {
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)
return oWindow;
}
</script>
</telerik:RadCodeBlock>

VB.NET:
ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind();", True)

Thoughts?




2 Answers, 1 is accepted

Sort by
0
Sean
Top achievements
Rank 1
answered on 25 Jun 2014, 03:28 AM
Just an update, reverting back to 2014.1.403.45 fixes the problem, all of the RadWindows work and close again.
0
Marin Bratanov
Telerik team
answered on 25 Jun 2014, 12:33 PM

Hello Sean,

I was able to reproduce a JavaScript error when a button in the RadWindow content page is clicked and I am logging it for fixing. You can track it here: http://feedback.telerik.com/Project/108/Feedback/Details/131960.

On my end this seems to alleviate the issue:

function CloseAndRebind() {
    GetRadWindow().BrowserWindow.refreshGrid();
    setTimeout(function () {
        var wnd = GetRadWindow();
        wnd.set_animation(0);//no animations
        wnd.close();
    }, 0);
}

I have also updated your Telerik points for your report.

The change in the control is that it uses an improved set of animations code that should perform faster, especially on mobile devices. The animations + autosizing + DestroyOnClose is what causes the problem. Thus, another workaround would be to disable animations.

Please accept my apologies for the inconvenience caused.

As for the error itself - it was different on my end and not the one you report, yet here is an override that should help with that - it adds a check for the only place where stopTransitions is called. Place that at the end of the form where the RadWindow control resides.

Telerik.Web.UI.RadWindow.prototype._hide = function () {
    if (!this.get_animation() || this.get_animation() == 0) {
        this._afterHide();
    }
    else {
        if (this._enableShadow && $telerik.isIE) {
            this._setShadowCSSClass(false);
        }
        var fnc = Function.createDelegate(this, this._afterHide),
            isMaximized = this.isMaximized(),
            duration = this.get_animationDuration();
        var popupElem = $telerik.$(this._popupElement);
        if (popupElem.stopTransition) {
            popupElem.stopTransition().transition({ opacity: 0 }, duration, "linear", function () {
                fnc(isMaximized);
            });
        }
    }
}

On autosizing - can you confirm you follow the guidelines from this help article: http://www.telerik.com/help/aspnet-ajax/window-troubleshooting-autosize-not-correct.html

I am attaching here the pages I test with and they seem to autosize correctly. You can find a video that shows this attached as well. I hope comparing your sample with mine will help you in this regard too.


Regards, Marin Bratanov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Window
Asked by
Sean
Top achievements
Rank 1
Answers by
Sean
Top achievements
Rank 1
Marin Bratanov
Telerik team
Share this question
or