Jan 21, 2011, 3:52 PM
[FIXED] [2.3] Property sourceFormatting="true" seems to generate invalid code.
When I set the EXT.net Global configuration property "sourceFormatting" to true in my web.config it seems to cause all my status bars generate an error similar to this when I try to update them within a direct method.
EXT.Net version: 1.0.3960.37522. (community)
Server: Win 2003 (IIS6)
Framework: .net 4
Browser: IE8-9, FireFox 3.6-4b9, Crome 8.0.552.237
Ext.net Global config line:
If I set sourceFormatting to false the SetStatus procedure works as expected. When you click the button the text in the status bar is updated. However if I set sourceFormatting to true then I get an error similar to the one listed (this one was from FireFox -- which produced the most useful message of all the browsers I tested in) when trying to update a status bar.
Example:
Error: invalid property id
Source File: http://testserver.int/extnet/extnet-core-debug-js/ext.axd?v=37522
Line: 2723, Column: 22
Source Code:
StatusBar1.setStatus({\r\n text: "Updated: 10:11:06 AM (server time)",\r\n clearIcon: true\r\n});Button1.setDisabled(false);
Configuration:EXT.Net version: 1.0.3960.37522. (community)
Server: Win 2003 (IIS6)
Framework: .net 4
Browser: IE8-9, FireFox 3.6-4b9, Crome 8.0.552.237
Ext.net Global config line:
<extnet cleanResourceUrl="true" gzip="true" renderStyles="Embedded" scriptAdapter="Ext" scriptMode="Debug" theme="Gray" sourceFormatting="true" idMode="Legacy" />
Details:If I set sourceFormatting to false the SetStatus procedure works as expected. When you click the button the text in the status bar is updated. However if I set sourceFormatting to true then I get an error similar to the one listed (this one was from FireFox -- which produced the most useful message of all the browsers I tested in) when trying to update a status bar.
Example:
<%@ Page Language="C#" %>
<%@ Import Namespace="Ext.Net.Utilities" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e) {
if (!X.IsAjaxRequest) {
this.ResourceManager1.RegisterIcon(Icon.Accept);
}
}
protected void UpdateStatusBar(object sender, DirectEventArgs e) {
// Delay the Thread for .5 seconds
System.Threading.Thread.Sleep(500);
string index = e.ExtraParams["index"];
Ext.Net.Button button = ControlUtils.FindControl(this.ResourceManager1, "Button" + index) as Ext.Net.Button;
StatusBar statusBar = ControlUtils.FindControl(this.ResourceManager1, "StatusBar" + index) as StatusBar;
statusBar.SetStatus(new StatusBarStatusConfig("Updated: " + DateTime.Now.ToLongTimeString() + " (server time)", ""));
button.Disabled = false;
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>StatusBar - Ext.NET Examples</title>
<link href="../../../../resources/css/examples.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.word-status .x-status-text
{
color: #777;
}
.word-status .x-status-busy
{
background: transparent url(images/saving.gif) no-repeat scroll 3px 3px !important;
padding-left: 25px !important;
}
.word-status .x-status-saved
{
background: transparent url(/icons/accept-png/ext.axd) no-repeat scroll 3px 3px !important;
padding-left: 25px !important;
}
</style>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<h1>
StatusBar Examples</h1>
<p>
Here are several examples of using and customizing the Ext.StatusBar component.</p>
<h2>
1. Basic StatusBar</h2>
<p>
This is a simple StatusBar with a few standard Toolbar items included.</p>
<ext:Panel ID="Panel1" runat="server" Title="Basic StatusBar" Width="350" Height="100"
Padding="10">
<Items>
<ext:Button ID="Button1" runat="server" Text="Do Loading">
<DirectEvents>
<Click OnEvent="UpdateStatusBar" Before="el.disable();#{StatusBar1}.showBusy();">
<EventMask MinDelay="2000" />
<ExtraParams>
<ext:Parameter Name="index" Value="1" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>
</Items>
<BottomBar>
<ext:StatusBar ID="StatusBar1" runat="server" DefaultText="Default status">
<Items>
<ext:Button ID="SBButton1" runat="server" Text="A Button" />
<ext:ToolbarSeparator ID="ToolbarSeparator1" runat="server" />
<ext:ToolbarTextItem ID="ToolbarTextItem1" runat="server" Text="Plain Text" />
</Items>
</ext:StatusBar>
</BottomBar>
</ext:Panel>
</form>
</body>
</html>
If my example looks familiar it is because I copied it directly from the sample site. :)
Last edited by Daniil; Jul 31, 2013 at 3:21 AM.
Reason: [FIXED] [2.3]