[FIXED] [V0.5] TextField Bug
*NEW - Coolite Toolkit Version 0.6.0 now available for download or view examples.
 

Coolite Forums

Welcome Guest ( Login | Register )
 
[FIXED] [V0.5] TextField Bug
Subscribe
Last Login: 10/31/2008 11:55:04 AM
Posts: 11,
Posted 6/11/2008 7:54:56 PM

Group: Coolite Early Adopter
 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!!!!
Last Login: Today @ 11:56:26 AM
Posts: 1,172,
Posted 6/11/2008 9:07:03 PM

Group: Core Development Team
Can you please post the <ext:TextField> tag you use and/or the code-behind used to create the control?
--
Geoffrey McGill
Coolite Inc.
Core Developer
twitter [personal] [coolite]
Last Login: Today @ 11:56:26 AM
Posts: 1,172,
Posted 6/12/2008 2:51:22 AM

Group: Core Development Team
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" onclick="Button1_Click" Text="Submit" />
        <asp:Label ID="Label1" runat="server" />
    </form>
</body>
</html>


Hope this helps.
--
Geoffrey McGill
Coolite Inc.
Core Developer
twitter [personal] [coolite]
Last Login: 10/31/2008 11:55:04 AM
Posts: 11,
Posted 6/12/2008 4:52:33 AM

Group: Coolite Early Adopter
 
<%@ 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" onclick="Button1_Click" Text="Submit" />     
    </form>
</body>
</html>

Last Login: Today @ 11:56:26 AM
Posts: 1,172,
Posted 6/12/2008 5:37:51 PM

Group: Core Development Team
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
Coolite Inc.
Core Developer
twitter [personal] [coolite]
Last Login: 8/4/2008 5:14:34 AM
Posts: 6,
Posted 6/14/2008 10:40:31 AM

Group: Coolite Early Adopter
 that's well!
My English is very poor!
Can I say In Chinese When i ask question Next Time?


i am from suzhou china!
my english is very poor!
往事已成风
今日且随缘

Last Login: Today @ 11:56:26 AM
Posts: 1,172,
Posted 6/15/2008 1:02:46 AM

Group: Core Development Team
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
Coolite Inc.
Core Developer
twitter [personal] [coolite]
Last Login: 10/31/2008 11:55:04 AM
Posts: 11,
Posted 6/19/2008 8:42:20 AM

Group: Coolite Early Adopter
 The same bug that happend with TextField that i reported some days ago,now is happen with TextArea.
Last Login: Today @ 11:56:26 AM
Posts: 1,172,
Posted 6/19/2008 5:02:45 PM

Group: Core Development Team
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
Coolite Inc.
Core Developer
twitter [personal] [coolite]
« Prev Topic | Next Topic »
Reading This Topic
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.
All times are GMT -8:00, Time now is 12:23pm