Vaadin Switches, Horizontal, Not Vertical

I want to display my radio buttons in 1 line, for example:

β—Ž Option1 β—‰ Option2

However, with Vaadin, I can’t do this, it looks like this:

β—Ž Option1

β—‰ Option2

here is my code:

final List<String> options = Arrays.asList(new String[] { "hebele", "hubele"}); final OptionGroup group = new OptionGroup("", options); group.setNullSelectionAllowed(false); // user can not 'unselect' group.select("hubele"); // select this by default 

How can i change this?

+4
source share
2 answers

As explained in The Book of Vaadin , you must define a theme to customize your own style.css file.

You can then override the default style for the option displayed on the line as follows:

 .v-app .v-select-optiongroup .v-select-option { display:inline; } 
+3
source

With Vaadin 7.3, the Valo theme supports the horizontal OptionGroup without writing a custom style:

 OptionGroup group = new OptionGroup("", options); group.addStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL); 
+3
source

All Articles