Feb 01, 2012, 12:51 PM
[CLOSED] Panel did not refresh the content after manually trigger autoload
Hi:
I have a page which is to show the PDF file on it. Basically I generate a pdf on server side and send the file id to the page. The page load the file into the panel by the id. In the page, I got a dropdown list which can select the page size and a refresh button to refresh the panel. The page is working fine for Chrome and IE9 but when I test it on IE8 there is a issue.
In IE8 when page first time load it, everything is working fine. When I change the page size and click the refresh button, the panel shows the loading mask but never refresh the content unless you move the mouse to dropdown list drill down icon or select the other radio button on the page. This looks like the after autoload finished, the panel will not automatically refresh the content unless we do some activity on other Ext.Net control.
The page code is:
I have a page which is to show the PDF file on it. Basically I generate a pdf on server side and send the file id to the page. The page load the file into the panel by the id. In the page, I got a dropdown list which can select the page size and a refresh button to refresh the panel. The page is working fine for Chrome and IE9 but when I test it on IE8 there is a issue.
In IE8 when page first time load it, everything is working fine. When I change the page size and click the refresh button, the panel shows the loading mask but never refresh the content unless you move the mouse to dropdown list drill down icon or select the other radio button on the page. This looks like the after autoload finished, the panel will not automatically refresh the content unless we do some activity on other Ext.Net control.
The page code is:
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/ContentPage.Master"
Inherits="System.Web.Mvc.ViewPage<WBS.Workware.Web.UI.Views.Model.DocumentViewModel>" %>
<%@ Import Namespace="WBS.Workware.Application.Document" %>
<%@ Import Namespace="WBS.Workware.Web.UI.Common" %>
<script runat="server">
protected override void OnLoad(EventArgs e)
{
ShellHelper.RegisterClientScript("plugin-detector", "~/content/js/shell-print.js");
ResourceManager.GetInstance().RegisterOnReadyScript("$shellPrint.initialise();");
PanelContent.AutoLoad.Url = Url.Action("stream", "shell");
ComboBoxPaperSize.SelectedItem.Value = Model.Options.PaperSize.ToString();
CheckBoxScaleToFit.Checked = Model.Options.ScaleToFit;
SpinnerPagesTall.Value = Model.Options.VerticalPages;
SpinnerPagesWide.Value = Model.Options.HorizontalPages;
RadioLandscape.Checked = Model.Options.Orientation == PaperOrientation.Landscape;
RadioPortrait.Checked = Model.Options.Orientation == PaperOrientation.Portrait;
RadioPortrait.BoxLabel = String.Format("{0}<div class='shell-radio shell-page-portrait'></div>",
Strings.ShellPrintPortrait);
RadioLandscape.BoxLabel = String.Format("{0}<div class='shell-radio shell-page-landscape'></div>",
Strings.ShellPrintLandscape);
HiddenDocumentId.Value = Model.DocumentId.ToString();
base.OnLoad(e);
}
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
Document Viewer
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<form id="downloadForm">
</form>
<ext:Hidden runat="server" ID="HiddenDocumentId">
</ext:Hidden>
<ext:Viewport runat="server" Layout="FitLayout">
<Items>
<ext:Panel runat="server" Layout="BorderLayout" Border="false">
<TopBar>
<ext:Toolbar ID="Toolbar1" runat="server" StyleSpec="border-bottom-width: 0px;">
<Items>
<ext:Button runat="server" ID="ButtonClose" Text="<% $Resources: Strings, Close %>"
Icon="Cancel">
<Listeners>
<Click Handler="window.close();" />
</Listeners>
</ext:Button>
<ext:ToolbarSeparator />
<ext:Button runat="server" ID="ButtonRefresh" Text="<% $Resources: Strings, Refresh %>"
Icon="PageRefresh" IDMode="Static">
<Listeners>
<Click Handler="PanelContent.reload();" Delay="1"/>
</Listeners>
</ext:Button>
<ext:ToolbarFill />
<ext:ToolbarSeparator />
<ext:Button runat="server" ID="ButtonExportPdf" Text="<% $Resources: Strings, ShellPrintDownloadPdf %>"
Icon="PageWhiteAcrobat">
<DirectEvents>
<Click Url="~/Shell/Stream" IsUpload="true" CleanRequest="true" FormID="downloadForm">
<ExtraParams>
<ext:Parameter Name="documentType" Value="Pdf" Mode="Value" />
<ext:Parameter Name="streamMode" Value="Attachment" Mode="Value" />
<ext:Parameter Name="documentId" Value="HiddenDocumentId.getValue()" Mode="Raw" />
<ext:Parameter Name="options.paperSize" Value="ComboBoxPaperSize.getValue()" Mode="Raw" />
<ext:Parameter Name="options.orientation" Value="RadioGroupOrientation.getValue().inputValue"
Mode="Raw" />
<ext:Parameter Name="options.horizontalPages" Value="SpinnerPagesWide.getValue()"
Mode="Raw" />
<ext:Parameter Name="options.verticalPages" Value="SpinnerPagesTall.getValue()" Mode="Raw" />
<ext:Parameter Name="options.scaleToFit" Value="CheckBoxScaleToFit.getValue()" Mode="Raw" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
<Items>
<ext:FormPanel ID="Panel2" runat="server" Region="West" Width="200" Padding="0" Split="true"
Border="true" AutoScroll="true" MinWidth="200">
<LayoutConfig>
<ext:VBoxLayoutConfig Align="Stretch" Pack="Start" DefaultMargins="6 6 8 6" />
</LayoutConfig>
<Items>
<ext:Panel runat="server" Title="<% $Resources: Strings, ShellPrintPageSetup %>"
Frame="true" Height="160" Layout="FormLayout" LabelAlign="Top">
<Items>
<ext:ComboBox ID="ComboBoxPaperSize" runat="server" AllowBlank="false" AnchorHorizontal="80%"
ForceSelection="true" Editable="false" Mode="Local" FieldLabel="<% $Resources: Strings, ShellPrintPaperSize %>">
<Items>
<ext:ListItem Text="A4" Value="2" />
<ext:ListItem Text="A3" Value="3" />
<ext:ListItem Text="US Letter" Value="1" />
</Items>
</ext:ComboBox>
<ext:RadioGroup runat="server" ColumnsNumber="2" ID="RadioGroupOrientation" HideLabel="true">
<Items>
<ext:Radio ID="RadioPortrait" runat="server" InputValue="Portrait" />
<ext:Radio ID="RadioLandscape" runat="server" InputValue="Landscape" />
</Items>
</ext:RadioGroup>
</Items>
</ext:Panel>
<ext:Panel ID="PanelPageScaling" runat="server" StyleSpec="padding-bottom: 10px"
Title="<% $Resources: Strings, ShellPrintPageScale %>" Frame="true" Height="200"
Layout="FormLayout">
<Items>
<ext:Checkbox runat="server" ID="CheckBoxScaleToFit" BoxLabel="<% $Resources: Strings, ShellPrintScaleToFit %>"
HideLabel="true">
</ext:Checkbox>
<ext:SpinnerField runat="server" ID="SpinnerPagesWide" TabIndex="2" MinValue="1"
MaxValue="100" Width="60" FieldLabel="<% $Resources: Strings, ShellPrintPagesWide %>"
LabelAlign="Right">
</ext:SpinnerField>
<ext:SpinnerField runat="server" ID="SpinnerPagesTall" TabIndex="3" MinValue="1"
MaxValue="100" Width="60" FieldLabel="<% $Resources: Strings, ShellPrintPagesTall %>"
LabelAlign="Right">
</ext:SpinnerField>
</Items>
</ext:Panel>
</Items>
</ext:FormPanel>
<ext:Panel runat="server" ID="PanelContent" Border="true" Region="Center">
<AutoLoad Mode="IFrame" ShowMask="true" ManuallyTriggered="true">
<Params>
<ext:Parameter Name="documentType" Value="Pdf" Mode="Value" />
<ext:Parameter Name="streamMode" Value="Inline" Mode="Value" />
<ext:Parameter Name="documentId" Value="function(){return HiddenDocumentId.getValue(); }"
Mode="Raw" />
<ext:Parameter Name="options.paperSize" Value="function(){return ComboBoxPaperSize.getValue(); }"
Mode="Raw" />
<ext:Parameter Name="options.orientation" Value="function(){return RadioGroupOrientation.getValue().inputValue; }"
Mode="Raw" />
<ext:Parameter Name="options.horizontalPages" Value="function(){return SpinnerPagesWide.getValue(); }"
Mode="Raw" />
<ext:Parameter Name="options.verticalPages" Value="function(){ return SpinnerPagesTall.getValue(); }"
Mode="Raw" />
<ext:Parameter Name="options.scaleToFit" Value="function(){ return CheckBoxScaleToFit.getValue(); }"
Mode="Raw" />
</Params>
</AutoLoad>
</ext:Panel>
</Items>
</ext:Panel>
</Items>
</ext:Viewport>
<ext:Window runat="server" ID="WindowDetectionFailed" Modal="true" Width="550" Height="300"
Closable="false" Hidden="true" Layout="FormLayout" HideLabels="true" Padding="10"
Resizable="false" BodyCssClass="body-plain">
<Items>
<ext:Label ID="Label1" runat="server" Cls="shell-alert shell-warning" Text="<% $Resources: Strings, ShellPrintProblem %>">
</ext:Label>
<ext:Label ID="Label2" runat="server" Text="<% $Resources: Strings, ShellPrintPdfNotDetected %>">
</ext:Label>
<ext:DisplayField runat="server">
</ext:DisplayField>
<ext:RadioGroup runat="server" ColumnsNumber="1" ID="RadioDetectionChoice">
<Items>
<ext:Radio runat="server" Checked="true" ID="RadioContinueExcel" InputValue="Excel"
BoxLabel="<% $Resources: Strings,ShellPrintPdfNotDetectedExportExcel %>">
</ext:Radio>
<ext:Radio runat="server" ID="RadioContinuePDF" InputValue="Continue" BoxLabel="<% $Resources: Strings, ShellPrintPdfNotDetectedContinue %>">
</ext:Radio>
<ext:Radio runat="server" ID="RadioCancelPrint" InputValue="Close" BoxLabel="<% $Resources: Strings, ShellPrintPdfNotDetectedClose %>">
</ext:Radio>
</Items>
</ext:RadioGroup>
</Items>
<Buttons>
<ext:Button runat="server" ID="ButtonDetectionContinue" Text="<% $Resources: Strings, Continue %>">
<Listeners>
<Click Handler="
switch(RadioDetectionChoice.getValue().inputValue)
{
case 'Excel':
WindowDetectionFailed.hide();
ButtonExportXls.fireEvent('click');
break;
case 'Continue':
WindowDetectionFailed.hide();
PanelContent.reload();
break;
case 'Close':
window.close();
break;
}
" />
</Listeners>
</ext:Button>
</Buttons>
</ext:Window>
</asp:Content>
Last edited by Daniil; Feb 07, 2012 at 4:57 PM.
Reason: [CLOSED]