0

spinner and on_changing event

asked 2008-10-22 15:39:29 +0800

exactt gravatar image exactt
50 2

when listening to the on_changing event of a spinner object the actual value doesn't change until i leave the spinner object. my code looks as follows. (zk 3.5.1)


final Spinner index = new Spinner(3);
index.addEventListener(Events.ON_CHANGING, new EventListener(){
public void onEvent(Event event) throws Exception
{
System.out.println(index.intValue());
}
});

this always outputs "3". am i doing something wrong or is it a bug?

delete flag offensive retag edit

6 Replies

Sort by ยป oldest newest

answered 2008-10-23 11:19:06 +0800

exactt gravatar image exactt
50 2

updated 2008-10-23 11:19:46 +0800

is there a special reason that the spinner component is not mentioned in http://zkoss.org/doc/devref/ ???

link publish delete flag offensive edit

answered 2008-10-24 02:32:28 +0800

jumperchen gravatar image jumperchen
3909 2 8
http://jumperchen.blogspo... ZK Team

Hi,
1. The value of the component in onChaning event won't update it.
You should use event.value instead.
2.About the devref guide, you should post it a bug, then we can follow it.

link publish delete flag offensive edit

answered 2008-10-24 08:39:23 +0800

exactt gravatar image exactt
50 2

thx for the information. i have a little trouble accessing the event.value with my Java code. Can you help me out? Event.getData() returns null ...

i filed the documentation bug at https://sourceforge.net/tracker2/?func=detail&aid=2191395&group_id=152762&atid=785191

thx for the help!

link publish delete flag offensive edit

answered 2008-10-24 08:47:52 +0800

exactt gravatar image exactt
50 2

ok, nevermind. i found it out. i had to cast to InputEvent first. i always find this event thing kind of troublesome... is there any kind of documentation about which component fires which events? or where can i look it up in the source code? thx

link publish delete flag offensive edit

answered 2008-10-24 09:05:48 +0800

PeterKuo gravatar image PeterKuo
481 2

You can find events for components in developer reference, chapter 4. The XUL Components

If you want to look it up in the source code. getOuterAttrs() in Button.java is a good example. Events are likely to be registered like "appendAsapAttr(sb, Events.ON_FOCUS);"

link publish delete flag offensive edit

answered 2008-10-24 12:33:55 +0800

exactt gravatar image exactt
50 2

thx a lot for that information. i haven't checked on the documentation for quite some time. this will definitely help me a lot. regards.

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-10-22 15:39:29 +0800

Seen: 557 times

Last updated: Oct 24 '08

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