开发者

GWT ButtonCell Changing Text

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));
  }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜