Search code examples
gwtcelltable

GWT TextInputCell value change handler


I started using the CellTable widget. I need an editable text cell so I tried TextInputCell but to my dismay, I can't find the "value change handler".

How can I get notified when the cell content changes?


Solution

  • You don't need change handlers for cells. You set a FieldUpdater on your column. It has update() method which fires when value of a cell in this column changes. For example:

    myEditableColumn.setFieldUpdater(new FieldUpdater<T, String>() {
        @Override
        public void update(int index, T object, String value) {
            // do something when value changes
        }
    });