editorEnabled option for generated Column

I have one tab sheet on my screen and under one tab there is one data grid. I have generated a column for that data grid.

 DataGrid.Column networkIdColumn = networkRelationshipGrid.addGeneratedColumn("networkPublisherId", new DataGrid.ColumnGenerator<Status2, Object>() {
        public Object getValue(DataGrid.ColumnGeneratorEvent<Status2> event) {
          //business logic
           return "";

    public Class<Object> getType() {
        return Object.class;
}, 5);
networkIdColumn.setCaption("Publisher ID");

Now I want to enable inline editor for that generated column “networkPublisherId”. So by setEditable method I am trying to enable the inline editor but its not working. Following is the corresponding xml code for the same datagrid.

  <tab id="networkRelationshipTab"
                     caption="Network Relationships"
                    <dataGrid id="networkRelationshipGrid"
                              width="100%" >
                            <column property="mode" editable="true"/>
                            <column property="created" editable="false" />
                            <column property="value" editable="false"/>

Please guide me with this.


By default, a generated column can’t be edited because Inline Editor can’t infer a component to use as an editor field. In this case you need to define the EditFieldGenerator, e.g.:

private DataGrid<Order> ordersDataGrid;
private UiComponents uiComponents;

protected void onInit(InitEvent event) {
    ordersDataGrid.getColumnNN("amount").setEditFieldGenerator(orderEditorFieldGenerationContext -> {
        LookupField<BigDecimal> lookupField = uiComponents.create(LookupField.NAME);
        lookupField.setValueSource((ValueSource<BigDecimal>) orderEditorFieldGenerationContext
        lookupField.setOptionsList(Arrays.asList(BigDecimal.ZERO, BigDecimal.ONE, BigDecimal.TEN));

        return lookupField;


1 Like

Thankyou for your input!