PDA

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



Timothy
Oct 30, 2008, 12:40 PM
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:


<%@ 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"
FireSelect&#111;nload="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

geoffrey.mcgill
Oct 30, 2008, 1:10 PM
Hi Timothy,

We're investigating this issue right now.

Thanks for reporting the defect and providing a code sample.

Timothy
Oct 30, 2008, 1:15 PM
Thanks Geoffrey, let me know when I can unit test it again.

Cheers,
Timothy

Timothy
Oct 31, 2008, 10:39 AM
Any update on the following, or would it help with more examples?

Just curious as all my combos are broken with no revision number to revert to ;)

Cheers,
Timothy

geoffrey.mcgill
Oct 31, 2008, 12:08 PM
Hi Timothy,

Your sample is working with the latest SVN code, although I'm not going to say we've officially solved the problem. 


We're still working through some ideas with the AjaxEvents which may be causing some collateral damage at the moment.


I'll keep you updated. 

Timothy
Oct 31, 2008, 12:10 PM
Thanks Geoffrey, I've checked SVN and it is indeed working again.

Yes, please do keep me updated on the changes to the ComboBox.

Cheers,
Timothy

Timothy
Nov 01, 2008, 1:32 PM
You can mark this one solved.

Cheers again,
Timothy