addGeneratedColumn OnChangeEvent

I have the following addGeneratedColumn:

**myTable.addGeneratedColumn("number", entity -> {**
**    RadioButtonGroup<Double> radioField = uiComponents.create(RadioButtonGroup.class);**
**    radioField.setOrientation(HasOrientation.Orientation.HORIZONTAL);**

**    Map<String, Double> map = new LinkedHashMap<>();**
**    map.put("0", 0.0);**
**    map.put("0.5", 0.5);**
**    map.put("1", 1.0);**
**    radioField.setOptionsMap(map);**
**    radioField.setValue(map.get("0"));**

**    return radioField;**
**});**

Now I need a ClickEvent/OnChangeEvent so I can do validation on the selected radiobutton value.
I’ve tried:
ClickEvent, nothing happens when clicking on radiobutton
CollectionChangeEvent, only fires when loading the container, not when changing the radiobutton value
Table.SelectionEvent, fires when changing radiobutton, however with the old value of the radiobutton, not the new

How can I see which radiobutton is changed and what is the new value.
I also need to know the other data from my table.
Example:
Field1_1 Field2_1 Radiobutton1
Field1_2 Field2_2 Radiobutton2
Field1_3 Field2_3 Radiobutton3

If radiobutton1 is changed, I need to know the new value + field1_1 + field2_1

Hi.
Could you please clarify how did you add ClickEvent/OnChangeEvent? You chould add them right into addGeneratedColumn() method.

Regards,
Natalia

Hi Natalia,

I’ve added the handlers via ‘Generate Handler’ or via ‘Component Inspector- Handlers’ (ClickEvent)
Please explain how to add via addGeneratedColumn() and how to use that event.

Thanks!

Check the example in documentation

Hi Natalia,

Could you give an example that works with a RadioButtonGroup (that is added via addGeneratedColumn)?