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.
Open a combobox
Hello everybody
Is there a way to automatically open a combobox with java code ?
Maybe simulating user click ?
Thanks.
Sorry, no, not at the moment. What would your use case be?
I make a custom navigation breadcrumb like in explorer on windows vista/7.
So i must have a button and when we click on, a combobox is shown and is opened.
But I have find a solution using javascript (onclick() on ie and createEvent("MouseEvents") on others)
It's a really good think we can use javascript with vaadin but it would be better that we can put javascript id on vaadin components.
Here my solution get clickable item by classname. It's not really efficient.
Hi,
I'd suggest looking into themeing the ComboBox (or perhaps MenuBar would be simpler?) to look like a button using CSS. This would be way easier than getting a ComboBox to open programmatically.
The book has some instructions and there should be a wiki page on themeing somewhere, but I couldn't find it after a quick look.
HTH,
/Jonatan
This feature ( openPopup() and openPopup(int page) methods ) is included in PrefixComboBox add-on for Vaadin 8, which an extended ComboBox, a collection of missing features.