Is that addShortcutListener works globally??

Code:


fooField.addShortcutListener(new ShortcutListener("foo-field-enter", ShortcutListener.KeyCode.ENTER, null) {
            @Override
            public void handleAction(Object sender, Object target) {
                System.err.println("Foo accepts ENTER");
            }
        });

barField.addShortcutListener(new ShortcutListener("bar-field-enter", ShortcutListener.KeyCode.ENTER, null) {
            @Override
            public void handleAction(Object sender, Object target) {
                System.err.println("Bar accepts ENTER");
            }
        });

Then fooField never triggers action, but always barField. In other words, there is no way to make something like “ENTER” key moves focus to the next field, once requirements are met???

Vaadin version: 6.8.2

You can add shortcut listeners to panels -
see the small demo in the sampler
- so I see now reason why you couldn’t add an appropriate “process-enter” handler at that level.

HTH,

Cheers,

Charles.

Many thanks!