[CLOSED] Bug on change direct event of a textfield when there is a dropdownfield with a treepanel

  1. #1

    [CLOSED] Bug on change direct event of a textfield when there is a dropdownfield with a treepanel

    Hi, i've noticed the following bug: I have a screen in which there is a textfield and a lot of other controls, including a dropdownfield with a treepanel. In the change direct event of this textfield i load some content in the other controls. This screen worked perfectly in version 1.0.3909.21027. We then updated to version 1.0.3960.22203 a few time ago, and today i noticed that this screen is not working anymore. No error occurs, but no content is loaded in any control of the screen as long as the dropdownfield with a treepanel is present. If i remove it from the screen, the other controls get loaded normally. To illustrate the problem, i wrote this screen:

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            textBox1.DirectEvents.Change.Event += new ComponentDirectEvent.DirectEventHandler(Change_Event);
        }
    
        void Change_Event(object sender, DirectEventArgs e)
        {
            textBox2.Text = DateTime.Now.Second.ToString();
        }
    </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>Ext.Net Example</title>
    </head>
    <body>
        <form id="Form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <ext:TextField runat="server" ID="textBox1">
        </ext:TextField>
        <ext:TextField runat="server" ID="textBox2">
        </ext:TextField>
        <ext:DropDownField ID="dfDashboard" runat="server" Editable="false" Width="300" TriggerIcon="SimpleArrowDown"
            FieldLabel="Dashboard" LazyInit="false">
            <Component>
                <ext:TreePanel ID="tpDashboard" runat="server" Title="Itens Dashboard" Icon="Accept"
                    Height="220" Shadow="None" UseArrows="true" AutoScroll="true" Animate="true"
                    EnableDD="true" ContainerScroll="true" RootVisible="false">
                    <SelectionModel>
                        <ext:DefaultSelectionModel ID="DefaultSelectionModel1" runat="server">
                        </ext:DefaultSelectionModel>
                    </SelectionModel>
                    <Root>
                        <ext:TreeNode>
                            <Nodes>
                                <ext:TreeNode NodeID="660003_CON" Text="Documentos" Icon="FolderTable" Checked="False"
                                    Leaf="true" />
                            </Nodes>
                        </ext:TreeNode>
                    </Root>
                </ext:TreePanel>
            </Component>
        </ext:DropDownField>
        </form>
    </body>
    </html>
    Just write some stuff in textbox1 and leave the field. Notice that nothing is loaded into textbox2, it always stays blank. Now remove the dropdownfield and do the same. Notice that text is loaded normally into textbox2. Please, if there is a workaround for this without having to update from svn it would be perfect. We have to deliver this screen to our client on friday and i'm afraid that with new updates more problems will occurr.
    Last edited by geoffrey.mcgill; Nov 25, 2010 at 4:16 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Your code appears to function correctly for me.

    Here's a cleaned-up version.

    Example

    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
     
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            this.TextField1.DirectEvents.Change.Event += Change_Event;
        }
     
        void Change_Event(object sender, DirectEventArgs e)
        {
            this.TextField2.Text = DateTime.Now.Second.ToString();
        }
    </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 runat="server">
        <title>Ext.NET Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            
            <ext:TextField ID="TextField1" runat="server" />
            <ext:TextField ID="TextField2" runat="server" />
            
            <ext:DropDownField 
                ID="DropDownField1" 
                runat="server" 
                Editable="false" 
                Width="300" 
                FieldLabel="Dashboard" 
                LazyInit="false">
                <Component>
                    <ext:TreePanel 
                        ID="TreePanel1" 
                        runat="server" 
                        Title="Itens Dashboard" 
                        Icon="Accept"
                        Height="220" 
                        Shadow="None" 
                        UseArrows="true" 
                        AutoScroll="true" 
                        Animate="true"
                        EnableDD="true" 
                        ContainerScroll="true" 
                        RootVisible="false">
                        <SelectionModel>
                            <ext:DefaultSelectionModel runat="server" />
                        </SelectionModel>
                        <Root>
                            <ext:TreeNode>
                                <Nodes>
                                    <ext:TreeNode 
                                        NodeID="TreeNode1" 
                                        Text="Documentos" 
                                        Icon="FolderTable" 
                                        Checked="False"
                                        Leaf="true" 
                                        />
                                </Nodes>
                            </ext:TreeNode>
                        </Root>
                    </ext:TreePanel>
                </Component>
            </ext:DropDownField>
        </form>
    </body>
    </html>
    Geoffrey McGill
    Founder
  3. #3
    The behaviour i described doesn't happen to you? Have you tested with the version i told?
  4. #4
    Hi,

    I cannot reproduce the issue also.

    Have you tested with the version i told?
    That version number doesn't mean anything because it is generated by .NET builder and can be various for other developers because you build the assemblies on your local computer.

    We need to know your current SVN revision which you use for building assemblies (you can see that number in the context menu of your SVN repository folder Properties -> Subversion).

    Also, please check the issue with latest version (just for ensure that issue is not reproducible in the latest code)

    Please provide more details about the issue: is the request initiated (do you see the request in Fiddler or FireBug)? is remote (server side) handler executed (try to set breakpoint)? If the request is executed then what response do you have (see in the FireBug or Fiddler)? Can you create online version or send to the support email (support@object.net) your current assemblies
  5. #5
    It says "Revision 1"...

    Click image for larger version. 

Name:	revision.jpg 
Views:	111 
Size:	37.2 KB 
ID:	1947

    It stops in breakpoints on the server normally. This is the response (400 Bad Request) when DropDownField is present:

    <html>
        <head>
            <title>Bad Request</title>
            <style>
            	body {font-family:"Verdana";font-weight:normal;font-size: 8pt;color:black;} 
            	p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
            	b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
            	h1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
            	h2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
            	pre {font-family:"Lucida Console";font-size: 8pt}
            	.marker {font-weight: bold; color: black;text-decoration: none;}
            	.version {color: gray;}
            	.error {margin-bottom: 10px;}
            	.expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
            </style>
        </head>
        <body bgcolor="white">
    
                <span><h1>Server Error in '/WSMXM' Application.<hr width=100% size=1 color=silver></h1>
    
    
                <h2> <i>HTTP Error 400 - Bad Request.</i> </h2></span>
    
                <hr width=100% size=1 color=silver>
    
                <b>Version Information:</b>&nbsp;ASP.NET Development Server 9.0.0.0
    
                </font>
    
        </body>
    </html>
    When i remove the dropdownfield the response is this:
    {script:"textBox2.setValue(\"32\");"}
    Please tell if it's not enough, then i'll send the project to the support e-mail.
  6. #6
    Hi,

    It is fixed already.
    The problem is related with TriggerIcon="SimpleArrowDown" in the dropdown field. If remove it then the error is gone
    To fix the problem need to change C# file

    2. Ext.Net\Ext\Form\TriggerFieldBase.cs
    Change OnPreRender method
    protected override void OnPreRender(EventArgs e)
            {
                if (!Ext.Net.X.IsAjaxRequest)
                {
                    this.RegisterIcons();
                }
                base.OnPreRender(e);
            }
    Please note that we use new SVN repository
    http://svn.ext.net/premium/trunk
  7. #7
    Thanks Vlad, that solved the problem. I chose to just remove the TriggerIcon="SimpleArrowDown" for now.
  8. #8
    The Ext.NET RC2 release should be publicly available this week.

    It's the current source from http://svn.ext.net/premium/trunk
    Geoffrey McGill
    Founder

Similar Threads

  1. Replies: 1
    Last Post: Jun 29, 2012, 11:51 AM
  2. Replies: 1
    Last Post: Mar 29, 2012, 9:52 AM
  3. Replies: 2
    Last Post: Jan 25, 2012, 3:18 PM
  4. Replies: 5
    Last Post: Sep 19, 2011, 8:20 PM
  5. [CLOSED] [1.0] Issue with success property on direct event of textfield
    By bryantharpe in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: May 07, 2010, 5:06 PM

Posting Permissions