Wednesday, 14 August 2013

CellTable keep TextInputCell old value

CellTable keep TextInputCell old value

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() {
@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.
Thank's for your help.

No comments:

Post a Comment