[FIXED] [2.3] Property sourceFormatting="true" seems to generate invalid code.

  1. #1

    [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.

    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]
  2. #2
    Hi,


    Once (and only once) I faced with a similar issue in my Ext.Net practice. I spent a lot of time investigating the problem. Then I "accidentally" set sourceFormatting to false and my work appeared to be working properly. In that moment we just had no time to fix it.

    Thank you for the report. We are going to look into it again and will back to you.
  3. #3
    This bug has bitten me again as I work on upgrading my project to v2.x. Is there and update or an workaround for this? I really need to have sourceFormatting turned on as I workout bugs in my code but it is frustrating when it adds more "bugs".

    Regards,
  4. #4
    Could you, please, provide a test case?
  5. #5
    Quote Originally Posted by Daniil View Post
    Could you, please, provide a test case?
    Sure I can do that:
    <%@ Page Language="C#" %><%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <script runat="server">
        protected void FormSave(object sender, DirectEventArgs e) {
            FormStatusBar.SetStatus(new StatusBarStatusConfig { Text = "Form saved!", IconCls = " ", Clear2 = true });
        }
    </script>
    
    
    <!DOCTYPE html>
    
    
    <html>
    <head id="Head1" runat="server">
        <title>StatusBar Advanced - Ext.NET Examples</title>
        <link href="/resources/css/examples.css" rel="stylesheet" />
    </head>
    <body>
        <form id="Form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
            <ext:Panel ID="Panel1"
                runat="server"
                Title="StatusBar with Integrated Form Validation"
                Width="350"
                Height="250"
                Layout="Fit">
                <Items>
                    <ext:FormPanel
                        ID="StatusForm"
                        runat="server"
                        LabelWidth="75"
                        ButtonAlign="Right"
                        Border="false"
                        Padding="10">
                        <Defaults>
                            <ext:Parameter Name="Anchor" Value="95%" />
                            <ext:Parameter Name="AllowBlank" Value="false" Mode="Raw" />
                            <ext:Parameter Name="SelectOnFocus" Value="true" Mode="Raw" />
                            <ext:Parameter Name="MsgTarget" Value="side" />
                        </Defaults>
                        <Items>
                            <ext:TextField ID="TextField1" runat="server" FieldLabel="Name" BlankText="Name is required" />
                            <ext:DateField ID="DateField1" runat="server" FieldLabel="Birthdate" BlankText="Birthdate is required" />
                        </Items>
                        <Buttons>
                            <ext:Button ID="Button1" runat="server" Text="Save" Icon="Disk">
                                <DirectEvents>
                                    <Click
                                        OnEvent="FormSave"
                                        Before="var valid= #{StatusForm}.getForm().isValid(); if (valid) {#{FormStatusBar}.showBusy('Saving form...');} return valid;">
                                        <EventMask
                                            ShowMask="true"
                                            MinDelay="1000"
                                            Target="CustomTarget"
                                            CustomTarget="={#{StatusForm}.getEl()}" />
                                    </Click>
                                </DirectEvents>
                            </ext:Button>
                        </Buttons>
                    </ext:FormPanel>
                </Items>
                <BottomBar>
                    <ext:StatusBar ID="FormStatusBar" runat="server" DefaultText="Ready">
                        <Plugins>
                            <ext:ValidationStatus ID="ValidationStatus1"
                                runat="server"
                                FormPanelID="StatusForm"
                                ValidIcon="Accept"
                                ErrorIcon="Exclamation" />
                        </Plugins>
                    </ext:StatusBar>
                </BottomBar>
            </ext:Panel>
        </form>
    </body>
    </html>
    To trigger the issue set sourceFormatting="true" in your web.config file.

    I am running on:
    EXT.Net version: 2.2.0.1
    Server: Win 2003 (IIS6)
    Framework: .net 4

    I have tested it on IE 10, Chrome 28, and FireFox 22. They all generate an error similar to:
    Error: SyntaxError: invalid property id
    Source File: http://server/path/WebResource.axd?d...84594580000000
    Line: 1299, Column: 29
    Source Code:
    App.FormStatusBar.setStatus({\r\n "text": "Form saved!",\r\n "iconCls": " ",\r\n "clea
    If you set sourceFormatting="false" the page works as expected.

    Hope this helps,
    Attached Thumbnails Click image for larger version. 

Name:	Statusbarerror.PNG 
Views:	15 
Size:	11.9 KB 
ID:	6658  
  6. #6
    Thank you for the test case, reproduced. We will investigate.
  7. #7
    Fixed in SVN
  8. #8
    Quote Originally Posted by Vladimir View Post
    Fixed in SVN
    Thank-you.

Similar Threads

  1. Replies: 1
    Last Post: Jun 26, 2012, 11:29 AM
  2. [CLOSED] Hidden="true" behaves as Visible="false"
    By marco.morreale in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: May 28, 2012, 3:17 PM
  3. Replies: 5
    Last Post: May 02, 2012, 5:37 PM
  4. [CLOSED] DropDownField with Grow="true" and GrowMax="xxx"
    By deejayns in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 12, 2012, 12:00 PM
  5. [CLOSED] TreePanel : "invalid property id" error
    By coleg123 in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jul 23, 2011, 9:47 PM

Tags for this Thread

Posting Permissions