File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Android Security Essentials Live Lessons this week in the Android 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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: register KeyDownHandler on VerticalPanel
 
Similar Threads
Context Menu on Tree in GWT 2.0.3
Replace keycode value in Firefox
Gin problem
Context Menu not dispalyed on the Text area of the TinyMCE WYSIWYG editor in GWT
Tab Key and KeyListeners