开发者

GWT ButtonCell Changing Text

开发者 https://www.devze.com 2023-03-10 00:22 出处:网络
How can I change ButtonCell text that\'s embedded in celltable column when button pressed. I\'ve开发者_C百科 onnly seen setFieldUpdater.

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

精彩评论

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

关注公众号