How to print checkboxes from CheckboxGroup vertically insted horizontally. I tried to add this variant:
checkboxGroup.addThemeVariants(CheckboxGroupVariant.LUMO_VERTICAL);
but it doesn’t change anything. I’m working with Vaadin 14.
I copied this code to my app:
CheckboxGroup<String> checkboxGroup = new CheckboxGroup<>();
checkboxGroup.setLabel("Label");
checkboxGroup.setItems("Option one", "Option two", "Option three");
checkboxGroup.addThemeVariants(CheckboxGroupVariant.LUMO_VERTICAL);
Div value = new Div();
value.setText("Select a value");
checkboxGroup.addValueChangeListener(event -> {
if (event.getValue() == null) {
value.setText("No option selected");
} else {
value.setText("Selected: " + event.getValue());
}
});
and it didnt change to VerticalLayout, Label didnt show up and ValueChangeListener is not working too