Minimize and Restore cause reload on Webkit

2 posts, 0 answers
  1. Mike
    Mike avatar
    4 posts
    Member since:
    Oct 2007

    Posted 18 Oct 2010 Link to this post

    I'm using ASP.NET AJAX v.2010.1.519.35.

    I have an issue where the Minimize and Restore commands cause the content window to be refreshed on Web-kit based browsers.

    Here's the parent (default.aspx):

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <head runat="server">
        <title></title>
        <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
    </head>
    <body>
        <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <%--Needed for JavaScript IntelliSense in VS2010--%>
                <%--For VS2008 replace RadScriptManager with ScriptManager--%>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        </telerik:RadAjaxManager>
      
        <telerik:RadSkinManager ID="RadSkinManager1" Runat="server" Skin="Office2007">
        </telerik:RadSkinManager>
        <telerik:RadWindowManager id="WindowManager" runat="server" VisibleStatusBar="false" Behaviors="Close,Move,Resize" KeepInScreenBounds="True" ShowContentDuringLoad="True" Modal="true" Overlay="true">
            <Windows>
                <telerik:RadWindow runat="server" ID="Window1" Height="700px" Width="500px" Behaviors="Close,Move,Resize,Minimize,Maximize" RestrictionZoneID="chartTabsFrame" MinimizeZoneID="taskbar" Modal="false" InitialBehavior="Maximize"></telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager>
        <telerik:RadWindow ID="Window" runat="server"></telerik:RadWindow>
        <div>
            <a href="#" class="test-dynamic">Test Dynamic</a>
            <a href="#" class="test-static">Test Static</a>
        </div>
            <script type="text/javascript">
                window.onbeforeunload = function() { return 'Test'; }
                $('a.test-dynamic').click(function(e) {
                    var mgr = GetRadWindowManager();
                    var win = mgr.open(null, null);
                    win.setSize(700,700);
                    // Fixes onbeforeunload issue with IE
                    win.add_show(function(wnd) {
                        var elem = wnd.get_popupElement();
                        elem.onclick = function (e)
                        {
                            return $telerik.cancelRawEvent(e);
                        }
                    });
                    win.set_behaviors(Telerik.Web.UI.WindowBehaviors.Move + Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Resize +  Telerik.Web.UI.WindowBehaviors.Maximize +  Telerik.Web.UI.WindowBehaviors.Minimize);
                    win.setUrl('Window.aspx');
                    win.show();
                    win.maximize();
                    return false;
                });
                $('a.test-static').click(function(e) {
                    var win = GetRadWindowManager().getWindowByName('Window1');
                    win.setUrl('Window.aspx');
                    win.show();
                    win.maximize();
                    return false;
                });
            </script>
        </form>
    </body>
    </html>

    Where Window.aspx has:

    <%@ Page Language="C#" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <script runat="server">
     
    </script>
     
    <head runat="server">
        <title>Window</title>
    </head>
    <body>
        <form id="Form" runat="server">
        <div>
        Window
        </div>
        </form>
        <script type="text/javascript">
            alert(new Date());
        </script>
    </body>
    </html>

    When I click on "Test Dynamic", it seems to work fine. When I click on "Test Static", it refreshes when I minimize or restore.
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 21 Oct 2010 Link to this post

    Hello Mike,

    This is a known issue with the RadWindow control. The reason for this behavior is that WebKit / Mozilla browsers reload the content of an IFRAME when that IFRAME is moved in the DOM (what is actually happening when you use a MinimizeZone). Unfortunately, so far we haven't found a solution that:
    1. Produces consistent behavior in all browsers
    2. Is backward compatible
    so at this point, the only suggestion that I can give is to consider changing the logic and not to use MinimizeZone, but RadTabStrip like shown in our MDI demo.


    Kind regards,
    Georgi Tunev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top