Sunday, December 12, 2010

GWT tutorial KeyPressHandler bug using Firefox 3.6.13

I'm installing Java, Eclipse, and GWT on a new machine, and thought I
should run through the google gwt tutorial. On the Manage Events page
of the tutorial, some code is included to detect whether the enter key
is pressed:

// Listen for keyboard events in the input box.
newSymbolTextBox.addKeyPressHandler(new KeyPressHandler() {
public void onKeyPress(KeyPressEvent event) {
if (event.getCharCode() == KeyCodes.KEY_ENTER) {
addStock();
}
}
});

When I run the tutorial program using Firefox (3.6.13) and press the
enter key, event.getCharCode() keeps returning 0 instead of 13, which
is what KeyCodes,KEY_ENTER is defined as. So addStock() never gets
called. I'm trying this with jdk1.6.0_22, GWT 2.1.0, Helios Service
Release 1 for Eclipse, Windows 7, and Firefox 3.6.13.

It works if I use Internet Explorer 8, though.

Has anyone else run across this problem? Thanks.

--
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.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate