can anyone explain how to use listBox.fireEvent

299 views
Skip to first unread message

John V Denley

unread,
Sep 8, 2009, 11:25:46 AM9/8/09
to Google Web Toolkit
eclipse seems to prompt me to enter something like:

listBox.fireEvent(GwtEvent<?> event);

but I have no idea what that means, and it doesnt like the ?

is there any documentation on this anywhere, or am I just meant to
instinctively know what this means and how to use it?

PLEASE help me, ive just spend the last 3 hours trying to find an
example i can learn from, but have found it impossible!

Thanks,
John

Yanick

unread,
Sep 9, 2009, 1:19:26 PM9/9/09
to Google Web Toolkit
Yes, of course there is, right in the Javadoc (http://google-web-
toolkit.googlecode.com/svn/javadoc/1.6/index.html)

Look at the ChangeEvent constructor (for example), it says :
"Protected constructor, use DomEvent.fireNativeEvent
(com.google.gwt.dom.client.NativeEvent,
com.google.gwt.event.shared.HasHandlers) to fire change events."

So, do that :

DomEvent.fireNativeEvent(ChangeEvent.getType(), listbox);

and the listbox's fireEvent() will be called properly.

When the event to fire is not a DOM event, the xxxEvent class usually
implements a static public method "fire", that you can invoke like

xxxEvent.fire(source[, ...]);

Hope this clears up a bit. I was into that reading too actually last
night.
Reply all
Reply to author
Forward
0 new messages