I am using RadioButtonGroup to display Label with buttons on right. Below is the code snippet and snapshot of the buttons in RadioBtnWtCaption
contextRadioBtnGrp = new RadioButtonGroup<>("Context");
contextRadioBtnGrp.setItems("Current", "History");
contextRadioBtnGrp.addStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL);
horizontalLayout.addComponent(contextRadioBtnGrp);
The label is created on the first row and btns below it. I want to display the label and btns in single row next to each other like Context: o Current o History
SDS SDS:
I am using RadioButtonGroup to display Label with buttons on right. Below is the code snippet and snapshot of the buttons in RadioBtnWtCaption
contextRadioBtnGrp = new RadioButtonGroup<>("Context");
contextRadioBtnGrp.setItems("Current", "History");
contextRadioBtnGrp.addStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL);
horizontalLayout.addComponent(contextRadioBtnGrp);
The label is created on the first row and btns below it. I want to display the label and btns in single row next to each other like Context: o Current o History
Is there a way to do this?
Solved it using Form Layout.
FormLayout btnLayout1 = new FormLayout();
contextRadioBtnGrp = new RadioButtonGroup<>("Context");
contextRadioBtnGrp.setItems("Current", "History");
contextRadioBtnGrp.setStyleName("horizontal");
btnLayout1.addComponent(contextRadioBtnGrp);`