Oct 10, 2008, 12:57 PM
[FIXED] [V0.7.0] ComboBox Bug
Hello,
If you run the below example, you will notice a minor error in the SelectedIndex property.
Example.aspx:
1. Load page
2. Select 'Canada' from ComboBox1
3. Select 'Ontario' from ComboBox2
4. Click 'Submit', notice it changed to 'Quebec' on ComboBox2? (on purpose)
5. Notice the result says index = 0 (Ontario) when Quebec is selected (wrong)
Cheers,
Timothy
If you run the below example, you will notice a minor error in the SelectedIndex property.
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" onclick="Button1_Click" Text="Submit">
<Listeners>
<Click Handler="#{ComboBox2}.setValue('QC');" />
</Listeners>
</ext:Button>
<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. Click 'Submit', notice it changed to 'Quebec' on ComboBox2? (on purpose)
5. Notice the result says index = 0 (Ontario) when Quebec is selected (wrong)
Cheers,
Timothy