I've got a GWT app with a login step.
user enter its login/pass then press enter or login button to perform
login action.
If login is invalid a popup signals an error.
I want to be able to close the popup when user press ok button or when
he hits Esc or Enter.
I've added a onPreviewNativeEvent method to catch the event
public void onPreviewNativeEvent (NativePreviewEvent event) {
int keyCode = event.getNativeEvent().getKeyCode();
if ((KeyCodes.KEY_ENTER == keyCode) || (KeyCodes.KEY_ESCAPE ==
keyCode)){
btnOk.click();
}
}
It is working fine but the Enter Key is not totaly catched so once the
popup is closed the Ok button (for login action) is also triggered so
an other popup is open.
I try to consume or cancel the event calling event.consume(); or
event.cancel(); but I don't see any effect.
1th question what are the effect of
- consume and cancel ?
2nd question how can I "definitivelly" cancel an event to be sure that
no other component will handle it ?
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.