Oct 30, 2008, 11:40 AM
[FIXED] [V0.7] ComboBox Bug
Hello,
This one kind of crept in with the new revisions, was working perfectly before but I recently noticed it was failing in all cases in my product, check example hope it's simple to fix:
Example.aspx:
1. Load page
2. Select "Canada 1" from ComboBox
3. Notice the SelectedIndex on ajaxevent is -1 ? (Wrong, should be 0)
4. Select "Canada 2" from ComboBox
5. Notice the SelectedIndex on ajaxevent is now 0 ? (Wrong, should now be 1)
Looks like it's not sending the correct value back to the server until next AjaxEvent ;)
Cheers,
Timothy
This one kind of crept in with the new revisions, was working perfectly before but I recently noticed it was failing in all cases in my product, check example hope it's simple to fix:
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 drpCountry_Select(object sender, AjaxEventArgs e)
{
lblResult.Text = drpCountry.SelectedIndex.ToString();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="True" />
<ext:ScriptManager ID="ScriptManager2" runat="server" StateProvider="PostBack" />
<ext:ComboBox ID="drpCountry"
runat="server"
Editable="False"
EmptyText="Click here to Start"
FireSelectonload="True"
Mode="Local"
TriggerAction="All"
TypeAhead="False"
Width="255">
<AjaxEvents>
<Select Before="return !#{drpCountry}.initSelect;" OnEvent="drpCountry_Select" />
</AjaxEvents>
<Items>
<ext:ListItem Text="Canada 1" Value="CA1" />
<ext:ListItem Text="Canada 2" Value="CA2" />
<ext:ListItem Text="Canada 3" Value="CA3" />
<ext:ListItem Text="Canada 4" Value="CA4" />
</Items>
</ext:ComboBox>
<ext:Label ID="lblResult" runat="server" Text="Waiting ..." />
</form>
</body>
</html>
Replication steps:1. Load page
2. Select "Canada 1" from ComboBox
3. Notice the SelectedIndex on ajaxevent is -1 ? (Wrong, should be 0)
4. Select "Canada 2" from ComboBox
5. Notice the SelectedIndex on ajaxevent is now 0 ? (Wrong, should now be 1)
Looks like it's not sending the correct value back to the server until next AjaxEvent ;)
Cheers,
Timothy