0

onChanging event not everytime fired in Combobox

asked 2008-08-25 10:12:28 +0800

duro gravatar image duro
96 1

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?

delete flag offensive retag edit

9 Replies

Sort by » oldest newest

answered 2008-08-25 11:08:33 +0800

dastultz gravatar image dastultz
797 8

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.

link publish delete flag offensive edit

answered 2008-08-25 11:28:26 +0800

duro gravatar image duro
96 1

can be, but this error occures for me also when i type very slow. Seems when i delete the whole text with BACKSPACE in step 3, somethings bad happens. Btw. occurs in IE and also Firefox.

link publish delete flag offensive edit

answered 2008-08-25 15:04:18 +0800

robertpic71 gravatar image robertpic71
1275 1

updated 2008-08-25 15:06:28 +0800

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>

link publish delete flag offensive edit

answered 2008-08-25 15:36:55 +0800

duro gravatar image duro
96 1

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.

link publish delete flag offensive edit

answered 2008-08-25 16:23:34 +0800

robertpic71 gravatar image robertpic71
1275 1

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

link publish delete flag offensive edit

answered 2008-08-29 06:21:29 +0800

henrichen gravatar image henrichen
3869 2
ZK Team

Check this bug tracker.

http://sourceforge.net/tracker/index.php?func=detail&aid=2080346&group_id=152762&atid=785191

link publish delete flag offensive edit

answered 2008-11-14 09:40:42 +0800

Emanuele gravatar image Emanuele
117 1

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>


In combobox, if I tape a letter on keyboard, the onChanging event is thrown, but if I select an item with mouse, the onChanging event is not thrown like I were expecting. The same happens with datebox.

Should I post this problem on bug tracker?

bye
Emanuele

link publish delete flag offensive edit

answered 2008-11-14 19:39:15 +0800

jj gravatar image jj
638 3

Emanuele
User selecting an item would fire a different event: onSelect
onChanging only tracks the actual change to the text

link publish delete flag offensive edit

answered 2008-11-17 09:25:05 +0800

Emanuele gravatar image Emanuele
117 1

Ok, sorry for my quickly bad conclusion... :D

I add... for datebox, user selecting a day from the calendar fires the event onChange

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2008-08-25 10:12:28 +0800

Seen: 1,240 times

Last updated: Nov 17 '08

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More