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.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
LayoutClickListener: How to trigger a click with Javascript?
Hello!
I have the following problem:
My application makes use of LayoutClickListeners for some components (I built some UI elements as horizontal layouts, containing labels and icons, and made them interactive by adding a clicklistener to the containing layout).
Now I want to build frontend tests, and trigger clicks on those elements via JavaScript, e.g. like this:
document.getElementById('layoutId').click()
This works on all clickable elements like buttons, however, it does not work on said layouts. No matter where I trigger the click (on the layout itself or any of the contained items), there is no reaction.
Can anybody help me out a little bit? It seems those layout clicklisteners are implemented in a very special way. Any help regarding how I can trigger a working click action on those layouts would be greatly appreciated!
Best regards,
Chris