I need to use OptionGroup inside my table cell of one column. If one item is selected other item should be deselected. In general optiongroup we cannot add item to different cells of table. So I am using FlexibleOptionGroup. But I don’t know how to use this using table field factory like this. If propertyId.equals(“option”) the optiongroup Item should add to the table cell.
[code]
resultTable.setImmediate(true);
resultTable.setTableFieldFactory(new DefaultFieldFactory() {
public Field<?> createField(Container container, final Object itemId, Object propertyId,
Component uiContext) {
if (propertyId.equals(“option”)) {
}
Field field = super.createField(container, itemId, propertyId, uiContext);
field.setReadOnly(true);
return field;
}
Apparently FlexibleOptionGroupItemComponent doesn’t extend Field, which is what you would need in this particular case. Not surprising though, because the FieldFactory would probably go bananas with a setup like this… The other option is to build the functionality yourself. You would need to create a separate optiongroup for each property, and connect valueChangeListeners so that when one item is selected in another column, the current selection is made empty.
Hi,
Thank you for your response.
In below link (5th highlight) they have used FlexibleOptionGroup inside vaadin table.Can u tell me how to use as they mentioned in that link.
I want to use option group in every row.May be i was wrong of using field, can u suggest any other ?
Starting on row 228 he creates a Table and fills it with FlexibleOptionGroup components using a ColumnGenerator; I think this is exactly what is shown in the last screenshot in the Directory.
So, you can’t use FieldFactory since the partial OptionGroups aren’t Fields. But you can use generated columns, since those accept normal Components.