Thursday, July 30, 2009

Using the gwt KeyHandler instead of KeyboardListener

private void listenToSearch(final CustomTextBox searchBox)
{
searchBox.addKeyDownHandler(new KeyDownHandler()
{

public void onKeyDown(KeyDownEvent event)
{
if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER)
{
search(searchBox);
}

}
});
}