On 19 mar, 09:54, wayne <whon...@gmail.com> wrote:
> My code looks like:
>                 suggestBox.addKeyboardListener(new KeyboardListenerAdapter() {
>                         public void onKeyDown(Widget sender, char keyCode, 
> int modifiers) {
>                                 if(keyCode == KEY_ENTER);
>                                 {
>                                         
> System.out.println(suggestBox.getText());
>                                 }
>                         }
> The problem is, whenever I hit ANY key the console will print anything
> in the suggestbox.
> What's up with this, I'm pretty sure everything is in order.

I wouldn't be surprised that you don't get the KEY_ENTER (and
KEY_ARROW_xxx, FWIW) in your keyboard listener because the SuggestBox
handles (and cancels) them for the "suggestion menu".

If you want to know when a suggestion is selected use the appropriate
listener/handler (see the javadoc), but you won't be able to tell
whether it was by keyboard or by mouse (well, actually, when selecting
a suggestion by mouse, the box looses focus; I've run into troubles
with a custom RPCSuggestOracle because of this, doing something onBlur
and thus overriding the selected suggestion, which happens a few
"ticks" later)
--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to