[FIXED] [V0.5] TextField Bug

  1. #1

    [FIXED] [V0.5] TextField Bug

    Hi I have a problem a dont know if is a bug!
    The problem is this :
    My TextField is FILL and when a try (in runtime) to put a value "" (empty) in the TextField, dont work, is simple like this, dont empty the TextField!

    THIS IS A BUG?

    Thank you for all!!!!
  2. #2

    RE: [FIXED] TextField Bug

    Can you please post the <ext:TextField> tag you use and/or the code-behind used to create the control?
    Geoffrey McGill
    Founder
  3. #3

    RE: [FIXED] TextField Bug

    Hi egof,

    I tried a few tests with the TextField and everything appears to be working correctly. When you get a chance, please post a code sample demonstrating how to reproduce the problem.

    The following sample demonstrates the basic use of the TextField.

    Example

    <%@ Page Language="C#" %>
    
    <%@ Register assembly="Coolite.Ext.Web" namespace="Coolite.Ext.Web" tagprefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.TextField1.Text))
            {
                this.Label1.Text = "{Empty}";
            }
            else
            {
                this.Label1.Text = this.TextField1.Text;
            }
        }
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>TextField Test</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ScriptManager ID="ScriptManager1" runat="server" />
            
            <ext:TextField ID="TextField1" runat="server" />
            <ext:Button ID="Button1" runat="server" &#111;nclick="Button1_Click" Text="Submit" />
            <asp:Label ID="Label1" runat="server" />
        </form>
    </body>
    </html>
    Hope this helps.
    Geoffrey McGill
    Founder
  4. #4

    RE: [FIXED] TextField Bug

     <%@ Page Language="C#" %>
    
    <%@ Register assembly="Coolite.Ext.Web" namespace="Coolite.Ext.Web" tagprefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.TextField1.Text))
            {
                this.TextField1.Text = "hello world!!!";
            }
            else
            {
                this.TextField1.Text="";   //THIS IS THE POINT, HOW  CAN I SET TO EMPTY("") THE TextField?
            }			       // LIKE I DID DONT CHANGE ANYTHING!!!!
        }
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>TextField Test</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ScriptManager ID="ScriptManager1" runat="server" />
            
            <ext:TextField ID="TextField1" runat="server" />
            <ext:Button ID="Button1" runat="server" &#111;nclick="Button1_Click" Text="Submit" />       
        </form>
    </body>
    </html>
  5. #5

    RE: [FIXED] TextField Bug

    Fixed. It was a bug, and a very interesting one.

    If you're building from source, add the following attribute to the Value property of TextField.cs (approx line 69).

    Example

    [DefaultValue(null)]
    If the Text was empty ("") the ClientConfig script was ignoring property and not rendering the proper JavaScript to the browser. Now, the Text/Value will always render.

    The source has been updated and this fix will be available with the next public release (v0.5.2).

    Thanks again for pointing out the bug.
    Geoffrey McGill
    Founder
  6. #6

    RE: [FIXED] TextField Bug

    that's well!
    My English is very poor!
    Can I say In Chinese When i ask question Next Time?
  7. #7

    RE: [FIXED] TextField Bug

    Hi jumbot,

    Welcome to the forums! Huan yin!

    I think you have great english skills. Much better than my Chinese. ;)

    Feel free to post in the language of your choice, although I would suggest also translating as best you can into English.
    Geoffrey McGill
    Founder
  8. #8

    RE: [FIXED] TextField Bug

    The same bug that happend with TextField that i reported some days ago,now is happen with TextArea.
  9. #9

    RE: [FIXED] TextField Bug

    Hi egof,

    Good point. I should have caught the TextArea problem when fixing TextField. Sorry about that.

    The bug has been fixed with TextArea.

    I also did some work with <ext:NumberField> and added a new .Number property. The .Number property accepts a Double object. To clear the NumberField you can set the .Number property to Double.MinValue or use the new .Clear() Method.

    Hope this helps.

    The code above will be available with v0.6.0.
    Geoffrey McGill
    Founder

Similar Threads

  1. Replies: 6
    Last Post: Jun 11, 2010, 12:47 PM
  2. Replies: 2
    Last Post: Feb 01, 2009, 10:40 PM
  3. Replies: 1
    Last Post: Jan 21, 2009, 12:46 PM
  4. Replies: 7
    Last Post: Nov 13, 2008, 10:19 PM
  5. Replies: 4
    Last Post: Jul 05, 2008, 2:14 AM

Posting Permissions