How can I change ButtonCell text that's embedded in celltable column when button pressed. I've开发者_C百科 onnly seen setFieldUpdater. Also is there some easy way to update another CellTable column rather then accessing it directly
Cell widgets are "model-based" (MVP), you have to update the object rendered in the row (the one passed to the FieldUpdater) and then tell the CellTable that the value changed and it should redraw (use setRowData, using the index passed to the FieldUpdater). Something like:
new FieldUpdater<MyObject, String>() {
@Override
public void update(int index, MyObject object, String value) {
object.setSomeField("foo");
cellTable.setRowData(index, Collections.singletonList(object));
}
}
精彩评论