(See edit in last post regarding SelectBox)
I'm just going to go over a bunch of things, some have come up in the past.
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
<title>Test34</title>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" ViewStateMode="Enabled" ScriptMode="Debug" SourceFormatting="true" />
<ext:Viewport ID="vp" runat="server" Layout="VBoxLayout">
<LayoutConfig>
<ext:VBoxLayoutConfig Align="Stretch" />
</LayoutConfig>
<Items>
<ext:Panel runat="server" Flex="1" Title="test" Layout="FormLayout">
<Items>
<ext:ComboBox ID="CB1" runat="server" AutoFocus="true" ForceSelection="true" TypeAhead="true" QueryMode="Local" Width="80" TriggerAction="Query" >
<SelectedItems>
<ext:ListItem Value="B Select" />
</SelectedItems>
<Items>
<ext:ListItem Text="A Select" Value="A Select" />
<ext:ListItem Text="B Select" Value="B Select" />
<ext:ListItem Text="BB Select" Value="BB Select" />
<ext:ListItem Text="C Select" Value="C Select" />
<ext:ListItem Text="CD Select" Value="CD Select" />
<ext:ListItem Text="D Select" Value="D Select" />
<ext:ListItem Text="D Select" Value="D Select" />
<ext:ListItem Text="F Select" Value="F Select" />
</Items>
<Listeners>
<Select Handler="alert('select1');" />
<Change Handler="alert('change1');" />
</Listeners>
</ext:ComboBox>
<ext:Button OnClientClick="#{CB2}.show();#{CB2}.setDisabled(false);" Text="Show CB2" />
<ext:ComboBox ID="CB2" runat="server" Editable="false" ForceSelection="true" Width="80" Hidden="true" Disabled="true">
<SelectedItems>
<ext:ListItem Value="B Select" />
</SelectedItems>
<Items>
<ext:ListItem Text="A Select" Value="A Select" />
<ext:ListItem Text="B Select" Value="B Select" />
<ext:ListItem Text="BB Select" Value="BB Select" />
<ext:ListItem Text="C Select" Value="C Select" />
<ext:ListItem Text="CD Select" Value="CD Select" />
<ext:ListItem Text="D Select" Value="D Select" />
<ext:ListItem Text="D Select" Value="D Select" />
<ext:ListItem Text="F Select" Value="F Select" />
</Items>
<Listeners>
<Select Handler="alert('select2');" />
<Change Handler="alert('change2');" />
</Listeners>
</ext:ComboBox>
<ext:TextField runat="server" Text="Text">
<Listeners>
<Change Handler="alert('text');" />
</Listeners>
</ext:TextField>
</Items>
</ext:Panel>
</Items>
</ext:Viewport>
</form>
</body>
</html>
First thing to note. (1) Even though Selected Items is in the initialization, we still get a change event and change1 is alerted. (2) Then to make matters worse, even the hidden/disabled change2 is as triggered as well. Using Text or Value or both in the SelectedItems List Items makes no difference. The only way to prevent this is to instead set Text="B Select". Okay, I get it (sorta) but it doesn't make sense to have any initialize element fire when no other time does it. The Select Event didn't, and yet selection was enforced. (3)Moreover, if you set Text="123", change fires. I guess because ForceSelection sets the value to empty after failing to match an item in the list. Still, set Text in a TextField and no change is ever fired. Inconsistency!!!!! Initialization events shouldn't fire.
Second thing to note, I set autofocus on CB1 so you should be able to start typing, say a letter 'c'. (4)Immediately I get change1 alerted, yet force selection hasn't selected the first item from 'C Select' from the list. Ok, fine, I have editable on. I press space after, and no change event. That's interesting for sure. Press another space. change1 sometimes fired, then an 's'. change1 fired. I'm moving towards completing "c select". Okay, still no query selection. I tab out, and it restores the original "B Select" value. Argh. So I consider, okay it's case sensitive and Try again. I enter "C". No difference. Then I realize, okay, so this isn't working so I remove the change listener on CB1 altogether and behavior changes. (5)BTW, the issue with space happens in the TextField as well. Sometimes I see the alert come up for an instant then removes immediately. Strange. I suspect a suspend after a trim in the js.
I start over after removing the change listener from CB1. Refresh the page, type 'c'. Ah ha! "C Select" is revealed. Tab away and select1. Yay. Desired behavior returned, but only when I remove the change listener. So apparently alert thwarts my test. I tried Change Handler=";" and behavior is good as well. I don't know what to think of this but is the alert suspending events?
(6) Now to talk about other nuances of unexpected behavior. I start in CB1. I click Left, Right, Home and End buttons. All behave within the TextField portion of CB1. Great. I click down arrow and pulldown appears. Now only Left and Right work in the text field but Home and End apply to the pulldown query. The thing is, I'd expect that only to occur when I click up and down to switch focus to the pulldown which I haven't done yet. Moreover, when I'm in the pulldown if I type a letter, text goes to the textfield instead of allowing me to select an item based the first letter typed in the pulldown where I expect focus. This makes the behavior very different from Windows Forms but quite cool if we're using query. I expect focus between the text field and the pulldown to relate to where I set focus so query won't do justice for my needs. Not ideal.
So I start playing with CB2 without the query and with Editable false and Force Selection true. I also remove the change event. I push the button to turn it on. First problem now is I can't select any items unless the trigger is down. So I press down or click on the pulldown trigger. I type a letter, nada. No selection available. So I add Query="Local". No difference. AutoSelect="true" neither. Hmmm. There seems to be no way to select items by typing. I remove Query and add TypeAhead="true". No difference. I try with editable and behavior returns to the same issues I had with CB1.