May 17, 2012, 6:33 PM
[CLOSED] Loader with Html renderer and Window rendering
Hi,
I'm trying to use the Html mode of the loader within a panel. This works fine on first load, but subsequent loads corrupt any windows that have been rendered previously. From digging around with this it appears that any windows are rendered to the end of the document body rather than the place holder for the loaded content. So ,for a panel it's fine because it renders to the place holder and then on reload that DOM element is replaced with the new panel. But any windows have been rendered to the document body and so on reload they still exist as they haven't been replaced causing issues that are similar to ID conflicts.
Please see test case below:
Parent View:
Hope you can help.
I'm trying to use the Html mode of the loader within a panel. This works fine on first load, but subsequent loads corrupt any windows that have been rendered previously. From digging around with this it appears that any windows are rendered to the end of the document body rather than the place holder for the loaded content. So ,for a panel it's fine because it renders to the place holder and then on reload that DOM element is replaced with the new panel. But any windows have been rendered to the document body and so on reload they still exist as they haven't been replaced causing issues that are similar to ID conflicts.
Please see test case below:
Parent View:
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<!DOCTYPE html>
<html>
<head runat="server">
<title>ViewParent</title>
<ext:ResourceManager runat="server" ID="ParentResourceManager">
</ext:ResourceManager>
</head>
<body>
<ext:Viewport runat="server" Layout="FitLayout">
<Items>
<ext:Panel ID="PanelShellLoaderHtml" runat="server" Layout="FitLayout">
<TopBar>
<ext:Toolbar runat="server">
<Items>
<ext:Button runat="server" Text="Refresh" OnClientClick="#{PanelShellLoaderHtml}.loader.load();"></ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
<Loader ID="Loader1" runat="server" Url='<%# Url.Action("ViewChild") %>' AutoDataBind="True" Mode="Html" Scripts="True">
<LoadMask ShowMask="True" />
</Loader>
</ext:Panel>
</Items>
</ext:Viewport>
</body>
</html>
Child View<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<!DOCTYPE html>
<html>
<head runat="server">
<title>ViewParent</title>
<ext:ResourceManager runat="server" ID="ParentResourceManager" RenderScripts="None"
RenderStyles="None">
</ext:ResourceManager>
</head>
<body>
<ext:Window ID="Window1" runat="server" Title="This is the window" Width="400" Height="500">
</ext:Window>
<ext:Panel runat="server" Title="Main Panel" Layout="FitLayout">
</ext:Panel>
</body>
</html>
If you run this you'll see the window appear fine on the first load, but clicking refresh in the toolbar will cause the window to corrupt. Removing the window ID cause it to use a generated ID will work as there is no conflict. But I think this is still a bug as the document is never cleaned up and will leak these components, plus INamingContainer style names are not acceptable as I have a lot of custom client script which expects the Id's to be static.Hope you can help.
Last edited by Daniil; Jul 02, 2013 at 4:02 AM.
Reason: [CLOSED]