PDA

View Full Version : [FIXED] [V0.7.0] ComboBox Bug



Timothy
Oct 10, 2008, 11:14 AM
Hello,

Here is the example, simple to replicate:

Example.aspx:


<%@ 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)
{
Label1.Text = String.Format("{0} is index: {1}", ComboBox2.SelectedItem.Text, ComboBox2.SelectedIndex);
}
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Example</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="True" />
<ext:ScriptManager ID="ScriptManager2" runat="server" ScriptMode="Debug" />
<ext:ComboBox ID="ComboBox1"
runat="server"
EmptyText="----"
Width="255">
<Items>
<ext:ListItem Text="Canada" Value="CA" />
<ext:ListItem Text="United States" Value="USA" />
</Items>
<Listeners>
<Select Handler="#{ComboBox2}.clearValue();" />
</Listeners>
</ext:ComboBox>
<ext:ComboBox ID="ComboBox2"
runat="server"
EmptyText="----"
Width="255">
<Items>
<ext:ListItem Text="Ontario" Value="ON" />
<ext:ListItem Text="Quebec" Value="QC" />
</Items>
</ext:ComboBox>
<ext:Button ID="Button1" runat="server" AutoPostBack="True" &#111;nclick="Button1_Click" Text="Submit" />
<ext:Label ID="Label1" runat="server" Text="Waiting ..." />
</form>
</body>
</html>


Replication steps:

1. Load page
2. Select 'Canada' from ComboBox1
3. Select 'Ontario' from ComboBox2
4. Hit 'Submit' -- index = 0 (good)
5. Select 'United States' from ComboBox1
6. Hit 'Submit' -- index = 0 (wrong)

Cheers,
Timothy

Vladimir
Oct 10, 2008, 11:35 AM
Hi Timothy,

I added code which correctly handling the empty value on submit. The code in the svn

Timothy
Oct 10, 2008, 12:59 PM
Confirmed.

Thanks,
Timothy