Keyboard functionality problem in GWT

Desmond

Destroy Erase Improve
Staff member
Admin
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.
 
Top Bottom