-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
i experience than combobox is not fireing onChanging event when i think it should. My test example is here:
<combobox onChanging="copy.value=event.value" autodrop="true">
<comboitem label="aa" />
<comboitem label="aabc" />
<comboitem label="bb" />
<comboitem label="bbde" />
<comboitem label="cc" />
<comboitem label="ccdf" />
</combobox>
<textbox id="copy" readonly="true" />
how to reproduce:
1. focus combobox by clicking into it
2. type "a", than ENTER. Onchanging event fired, textbox value is set to "aa".
3. press BACKSPACE, than "c", than ENTER. Onchanging event fired, textbox value is set to "c". shouldn´t it be "cc"?
4. press "b", than ENTER. combobox value is set to "bb", but no event fired. shouldn´t the onChanging event be fired?
I recently found similar behavior. If you type too fast, it seems only the last keystroke triggers the event which seems fine - it's an optimization. But I found the same problem of editing the contents fails to refire. I have to focus away, then come back to get it to fire again.
It seems that the onChanging event is only fired for keyboardinput. There seems no action for autocompletion or mouse select.
i.e. type a and ENTER --> autocomplete selects aa, but on Change is only a
i.e. select an item via mouse --> no event fired
On the otherside: if i enter an "a" and use cursor up/down, the onChanging Event is fired always.
I don't know, is this a bug?
another issue with comobox:
When i correct to bb -> b (change field without autocompletion), onSelect event is fired
when i correct bb --> empty (backspace) --> no onSelect event is fired
/Robert
I forget the code for the selectItem:
<window> <combobox id="combo" onChanging="copy.value=event.value" onSelect="select.value=self.getSelectedItem().getValue()" autodrop="true"> <comboitem label="aa" value="aa"/> <comboitem label="aabc" value="aabc"/> <comboitem label="bb" value="bb"/> <comboitem label="bbde" value="bbde"/> <comboitem label="cc" value="cc"/> <comboitem label="ccdf" value="ccdf"/> </combobox> onChanging: <textbox id="copy" readonly="true" /> onSelect: <textbox id="select" readonly="true" /> </window>
yes, for me also seems that the onChanging event is only fired for keyboardinput. Is my example from the 1st post behaving the same way when u try? My problem there is not that there is no onChanging event for mouse (although that is also quite bad), but that the onChanging event will sometimes not be fired even when i only use the keyboard.
Yes i can confirm your test. (My code in 3.0.5 FL in the ZK Explorer)
When the value "bb" is marked and i type "a" (without deleting this with backspace before) and hit enter, no onChanging-Event is fired.
/Robert
Using ZK 3.5.1, again I'm facing problem with onChanging event. I think it's a bug. Try the following example:
<vbox> <label value="Value to be changed:"/> <combobox onChanging="comboValueTB.value=event.value"> <comboitem value="1" label="value 1"/> <comboitem value="2" label="value 2"/> <comboitem value="3" label="value 3"/> </combobox> <datebox onChanging="dateboxValueTB.value=event.value"/> <hbox><label value="combobox value:"/><textbox id="comboValueTB"/></hbox> <hbox><label value="datebox value:"/><textbox id="dateboxValueTB"/></hbox> </vbox>
Asked: 2008-08-25 10:12:28 +0800
Seen: 1,246 times
Last updated: Nov 17 '08