permaculture playing cards*
The moose likes GWT and the fly likes register KeyDownHandler on VerticalPanel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » GWT
Bookmark "register KeyDownHandler on VerticalPanel" Watch "register KeyDownHandler on VerticalPanel" New topic
Author

register KeyDownHandler on VerticalPanel

Yahya Elyasse
Ranch Hand

Joined: Jul 07, 2005
Posts: 510

hello,
I have a gwt VerticalPanel class that i need to handel KeyDown events for it.
the method i used to implement keyboard handler in my class is:
i add :

to constructor
then i override method onBrowserEvent() to handle key down event.



however this method doesn’t work for this VerticalPanel class which extends a VerticalPanel.no KeyDown Event is fired when i press a key!

there are specific gwt widgets that support KeyDownHandler like Button etc..VerticalPanel is not one of them..so we need a work around to register a KeyDownHandler on a class extending VerticalPanel.
can you suggest an idea or hint?
thanks

thanks
Suhas Bilaye
Ranch Hand

Joined: Sep 10, 2009
Posts: 80
Hi,

You need to implement the HasKeyDownHandlers interface in order to add the key down handler capability to your vertical panel.




Thanks and Regards,
Suhas
http://www.xplore-java.blogspot.com/
Yahya Elyasse
Ranch Hand

Joined: Jul 07, 2005
Posts: 510

Suhas Bilaye wrote:Hi,

You need to implement the HasKeyDownHandlers interface in order to add the key down handler capability to your vertical panel.




yes I solved it by wrapping VerticalPanel inside a FocusPane. gwt Focuspanel support most events handlers including key events.
thanks for the reply.
 
jQuery in Action, 2nd edition
 
subject: register KeyDownHandler on VerticalPanel