Hi,

I am trying to mock a tab event. The requirement is  that whenever an
enter is pressed, the focus should move to next input box, similar to
tab. For that I have written a widget which handles key press handler
and on key press method i catch the enter event and raise a tab event.
However the raised tab event has no effect.

The handler looks like

public void onKeyPress(KeyPressEvent event) {
                int keyCode = event.getNativeEvent().getKeyCode();

                if (keyCode == KeyCodes.KEY_ENTER) {
                        event.stopPropagation();
                        NativeEvent nativeEvent =
Document.get().createKeyPressEvent(false,false,false,false,KeyCodes.KEY_TAB);
                        DomEvent.fireNativeEvent(nativeEvent, this, 
this.getElement());

                }

        }

-- 
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-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to