Label as an Item on Option Group in vaadin

Hello,

i have a question.
I want to underline one item (not all items) on my option group.
I read on the book tutorial of the vaadin, by writing the code (see below) on the css, the item will be underlined.


 .v-checkbox label {
    text-decoration: underline;
}

But it underline all items on my option group (see screenshot of op1).

I dont want it…

Lets say, i just want to underline the Tuning 25 on the Removal column. So, i tried to write like this on my java code:


        Label removal = new Label ("Removal");
        addComponent(removal);
	
        OptionGroup tuningPosition = new OptionGroup();
        tuningPosition.setMultiSelect(true);
        tuningPosition.setWidth("170px");
        tuningPosition.addItem("Tuning23");
        Label item = new Label("Tuning25");
        item.addStyleName("item");
        tuningPosition.addItem(item);
        tuningPosition.addItem("Tuning27");
        tuningPosition.addItem("Tuning30");
        addComponent(tuningPosition);

But when i checked on my firebug, the option group has its own structure where all its items are defined automatically as label for = "gwt-uid-12" .
How to addStyleName to this <label for = "gwt-uid-12> so it could be like this maybe?? <label class= "item" for= "gwt-uid-12>


<div style="float: left; margin-left: 0px;">
   <div class="v-select-optiongroup" style="width: 170px;">
    <span class="v-checkbox v-select-option">
     <span class="v-checkbox v-select-option">
      <input id="gwt-uid-12" type="checkbox" tabindex="0">
       <label for="gwt-uid-12">&lt;u&gt;Tuning 25&lt;/u&gt;</label>
      </span>
     <span class="v-checkbox v-select-option">
    <span class="v-checkbox v-select-option">
   </div>
</div>

anyeone can help me?
12325.jpg

I think the FlexibleOptionGroup add-on is your bets choice at the moment, until we get ItemStyleGenerator support for the core OptionGroup.

You can also use the HTML mode for the OptionGroup (which I don’t personally like because of the security considerations)

thank you very much for your answers :slight_smile:

I really appreciate it.

Hello,

Is there a way to put whole layout as an OptionGroup item?

My goal is to divide form into two areas and user can enable only one of those parts at time, by checking radio button next to it.
Is it achievable in Vaadin 6 ?