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.
CheckBox and RadioButtons in a Menu?
Hello,
we are currently evaluating Vaadin as our framework and are wondering if there exists some way to have checkboxes and RadioButtons in the menu bar ?
So far I did only see menu->submenu->separators and Icons.
But I don't see a way to have a RadioButton style group in the menu,
nor do I see a way to "Check" a menuentry.
André
André Schild: we are currently evaluating Vaadin as our framework and are wondering if there exists some way to have checkboxes and RadioButtons in the menu bar ?
I'm afraid that MenuBar does not support such functionality at the moment, but I've implemented radiobutton-like menus using the icons supported by menuitems. It was pretty straightforward, just track the "radiobutton" state when user activates the menu commands, and assign "on" or "off" icon to the menuitems as appropriate when the state changes. It would be easy to simulate checkboxes in the same way too.
Henri Muurimaa:
André Schild: we are currently evaluating Vaadin as our framework and are wondering if there exists some way to have checkboxes and RadioButtons in the menu bar ?
I'm afraid that MenuBar does not support such functionality at the moment, but I've implemented radiobutton-like menus using the icons supported by menuitems. It was pretty straightforward, just track the "radiobutton" state when user activates the menu commands, and assign "on" or "off" icon to the menuitems as appropriate when the state changes. It would be easy to simulate checkboxes in the same way too.
Good idea, I think that will do the job.
We don't use the RadioButton menu items very often,
but the Checkboxes (or Selected) are widely used by us.
Thanks
André
The "selected" behavior should be included in the default MenuBar implementation, worth a ticket.
I think the "radio button" behavior is best left to be handled by the developer with custom logic.
"Requested" :D
Thanks for the ticket. A good as well ticket, I might add :)
Jouni Koivuviita: The "selected" behavior should be included in the default MenuBar implementation, worth a ticket.
I think the "radio button" behavior is best left to be handled by the developer with custom logic.
Hi.....this would be like a toggle menu item?...was this implemented?
regards,
Hugo