0

I use a CellTable with EditTextCell

When the EditTextCell fire the FieldUpdater, I want to do a validation and set the EditTextCell to the old value if validation fail. But I cant find how to update the CellTable or the specified row.

Here a piece of code:

titleColumn.setFieldUpdater(new FieldUpdater<QuestionDto, String>() {

    @Override
    public void update(int index, QuestionDto object, String value) {

           if (!isValid(value)) 
                 // Here I need to set the EditTextCell to the value in my object
           else
                 // It's valid I do the work
       }
});

I was looking for something like : ((EditTextCell)titleColumn.getCell(index)).setValue(object.getTitle());

The other solution is to reset all the CellTable like that:

table.setRowData(dataProvider.getList());

But it's don't work too.

glautrou
  • 3,140
  • 2
  • 29
  • 34

1 Answers1

-1

I'm not very knowledgeable of EditTextCell but for other widgets I would catch the ChangeEvent (is it possible to catch it the cell you're using ?) then call event.stopPropagation() if I don't want the user action to have any effect.

Olivier Tonglet
  • 3,312
  • 24
  • 40