Monday, May 31, 2010

How to add new event to HandlerManager

Hi, I'm fairly new to GWT and I'm trying to add events to my
"eventBus"...

final HandlerManager eventBus = new HandlerManager(null);
..

eventBus.addHandler(RequestEvent.TYPE, new RequestEvent.Handler() {
public void onRequestEvent(RequestEvent requestEvent) {
if (requestEvent.getState() == State.SENT) {
System.out.println("RPC sent!");
}
}
});

This RequestEvent event works fine, but this doesn't work for
instance...or at least I don't think it works:
eventBus.addHandler(KeyPressEvent.getType(), new KeyPressHandler()
{
public void onKeyPress(KeyPressEvent arg0) {
System.out.println("Key pressed event!");
}
});

Any tips are greatly appreciated!

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment