Dears
I have a table which have a combobox column , in valueChange listener of combobox I generate another column . all think is OK and second column was added but I lost value of combobox and it was reset
as I understand , generateCell function run two time
could you help me?
you can see my code in below
thanks
Golriz
getTable().addGeneratedColumn(“action”, new Table.ColumnGenerator() {
@Override
public Object generateCell(Table source, Object itemId, Object columnId) {
ComboBox comboBox = new ComboBox();
comboBox.addListener(new Property.ValueChangeListener() {
@Override
public void valueChange(Property.ValueChangeEvent event) {
taskTable.getTable().addGeneratedColumn("rejectReason", new Table.ColumnGenerator() {
@Override
public Object generateCell(final Table source1, final Object itemId1, Object columnId1) {
ComboBox comboBox1 = new ComboBox();
comboBox1.select(((BeanItemContainer) comboBox1.getContainerDataSource()).firstItemId());
return comboBox1;
}
});
}
});
return comboBox;
}
});