OptionGroup FieldGroup

How can I use OptionGroup with FieldGroup? I’ve tried to bind the items of OprionGroup (single selection = RadioButton) but I didn’t find the method, neither for attaching a Converter (in my existing DB i’ve one string field that is “S” for true and “N” for false.
Anyone tried this case?
Thanks in advance

You should bind the field normally to a FieldGroup; the options themselves aren’t bound to anything. Just add all the options to the OptionGroup manually. When you bind a Field to a FieldGroup, what is bound is the value. In this case it is one of the options you have added; the ItemId of the selected option which is whatever you put in the method call ‘addItem(“thisIsTheItemId”)’. You can use a converter to convert the value (“thisIsTheItemId”) to another String (e.g. “S”), but in this case there is a simpler way.

Instead off adding a “Visible caption for item ‘S’” item, you should add whatever you have in your DB (such as “S” and “N”). Then use OptionGroup.setItemCaption(“S” ,“Visible caption for item ‘S’”) to override the caption. The value of the OptionGroup will now be “S”, so no conversions are necessary.

Thanks, but in optionGroup I put two items (radios): the first item should bind the the property A (S=true, N=false) from DB, the second item should bind the property B (S=true, N=false). OptionGroup is bindable but how can I select to which item to bind? Can I do with two option groups?

In Vaadin, Field = Property (field actually extends the property interface). So, if you have two properties, you need two fields.

Ok. The field is OptionGroup, not the Radio.
Thanks a lot