DIGIT-ARC read-only archive · snapshot: July 23, 2026

Keyboard functionality problem in GWT

2 posts · originally from https://geek.digit.in/community/threads/keyboard-functionality-problem-in-gwt.150325/

Desmond
Desmond Original post #1
Dec 22, 2011 at 12:59 PM
Hi,

I am learning GWT and want to create an application which can add entries to a table when I press enter. For this purpose I have used the following method:

Code:
newSymbolTextBox.addKeyPressHandler(new KeyPressHandler() {
		      public void onKeyPress(KeyPressEvent event) {
		    	  System.out.println(""+event.getCharCode());
		        if (event.getCharCode()==KeyCodes.KEY_ENTER) {
		          addData();
		        }
		      }
		    });

However, this is not working for some reason. I ran the debugger and found out that the KeyCodes class cannot be resolved, even though its been imported. Is there something I have overlooked? Please help.
Desmond
Desmond #2
Jan 10, 2012 at 1:20 AM
Anyone? Anyone at all?