Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 1 month ago
Fire ShortcutListener programatically
Good day, I have a ENTER ShortcutListener attached to a TextField. Is it possible to call this listener from tests, e.g. by calling UI.keyPress(ENTER) or something similar - similar to Button.click? Thanks ;)
Last updated on
Sometimes the easiest approach is the right one :) Instead of navigating through the ActionManager hierarchy, I just remember the shortcut listener in the component's field; the component has an additional method which simply calls the shortcut listener:
void fireEnterKeypress() {
if (enterShortcutRegistrator != null) {
enterShortcutRegistrator.handleAction(null, null);
}
}
Last updated on
You cannot reply to this thread.