user1700945
user1700945

Reputation: 125

Vaadin OptionGroup caption location

I am trying to get an OptionGroup to have the labels next to them, on the right hand side like normal radio buttons in every other UI I have ever used, instead of underneath them. I do not see anything in the API regarding how to change the layout of this? Anyone point me in the correct direction?

Upvotes: 3

Views: 1872

Answers (2)

Balakrishna
Balakrishna

Reputation: 33

Follow these steps: Add these lines to your css

.v-select-optiongroup-horizontal .v-select-option {
display: inline-block;
}

.v-select-optiongroup-horizontal {
white-space: nowrap;
}

.v-select-optiongroup-horizontal
.v-select-option.v-radiobutton {
padding-right: 10px;
}

And call

group.setStyleName("horizontal");

where group is the OptionGroup object.

Upvotes: 1

Gabriel Ruiu
Gabriel Ruiu

Reputation: 2803

Is it possible that you inherited some styles that display the text like that? Did you try to call hzl.setSizeUndefined()? Or maybe playing with the width (setWidth()).

Upvotes: 0

Related Questions