Oct 10, 2008, 3:15 PM
RE: [FIXED] [V0.7.0] ComboBox Bug
Here is another example.
Example.aspx:
1. Load page
2. Select 'Canada', 'Ontario', 'Ottawa'
3. Hit 'Submit' (works)
4. Hit 'Submit' again (fails) ?
Cheers,
Timothy
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="----"
FireSelectonload="True"
Width="255">
<Items>
<ext:ListItem Text="Create new Country..." Value="" />
<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="----"
FireSelectonload="True"
Width="255">
<Items>
<ext:ListItem Text="Create new Province ..." Value="" />
<ext:ListItem Text="Ontario" Value="ON" />
<ext:ListItem Text="Quebec" Value="QC" />
</Items>
<Listeners>
<Select Handler="#{ComboBox3}.clearValue();" />
</Listeners>
</ext:ComboBox>
<ext:ComboBox ID="ComboBox3"
runat="server"
EmptyText="-----"
FireSelectonload="True"
Width="255">
<Items>
<ext:ListItem Text="Create new City ..." Value="" />
<ext:ListItem Text="Ottawa" Value="OT" />
<ext:ListItem Text="Toronto" Value="TO" />
</Items>
</ext:ComboBox>
<ext:Button ID="Button1" runat="server" AutoPostBack="True" onclick="Button1_Click" Text="Submit">
<Listeners>
<Click Handler="
alert('ComboBox1.selectedIndex=' + #{ComboBox1}.selectedIndex + ' ' + 'ComboBox2.selectedIndex=' + #{ComboBox2}.selectedIndex + ' ' + 'ComboBox3.selectedIndex=' + #{ComboBox3}.selectedIndex);
if (#{ComboBox3}.selectedIndex &gt; 0) #{ComboBox3}.clearValue();
else if (#{ComboBox2}.selectedIndex &gt; 0) #{ComboBox2}.clearValue();
else #{ComboBox1}.clearValue();
"/>
</Listeners>
</ext:Button>
<ext:Label ID="Label1" runat="server" Text="Waiting ..." />
</form>
</body>
</html>
Replication steps:1. Load page
2. Select 'Canada', 'Ontario', 'Ottawa'
3. Hit 'Submit' (works)
4. Hit 'Submit' again (fails) ?
Cheers,
Timothy