当用户完成编辑后,如何获取GWT中EditTextCell的值

当用户完成编辑后,如何获取GWT中EditTextCell的值,gwt,Gwt,我是GWT的新手,我一直在尝试获取cellTable中EditTextCell的值,所以我想知道实现这一点的最佳方法是什么 谢谢当您在CellTable中有一个EditTextCell时,我想您的意思是您有一整列,如下所示: Column<RowObject, String> editTextCellColumn = new Column<RowObject, String>( new EditTextCell() ){ @Override public Str

我是GWT的新手,我一直在尝试获取cellTable中EditTextCell的值,所以我想知道实现这一点的最佳方法是什么


谢谢

当您在CellTable中有一个EditTextCell时,我想您的意思是您有一整列,如下所示:

Column<RowObject, String> editTextCellColumn = new Column<RowObject, String>( new EditTextCell() ){

  @Override
  public String getValue(RowObject object) {

    // return the value that is supposed to be displayed in the EditTextCell

  }
};
Column editTextCellColumn=新列(new EditTextCell()){
@凌驾
公共字符串getValue(RowObject对象){
//返回EditTextCell中应该显示的值
}
};
如果是这种情况,您可以简单地向列中添加fieldupdater。每次用户成功编辑文本单元格时,都会触发FieldUpdater

editTextCellColumn.setFieldUpdater( new FieldUpdater<RowObject, String>(){

  public void update(int index, final RowObject object, final String value) {

      // 'value' is the new value the user entered in the EditTextCell.
      // 'object' is the object that contains the old row information.
      // 'index' is the current row index of 'object'
      // Code for performing whatever you want to do with the new value goes here. 

  }
};
editTextCellColumn.setFieldUpdater(新的FieldUpdater(){
公共无效更新(int索引、最终行对象、最终字符串值){
//“value”是用户在EditTextCell中输入的新值。
//“对象”是包含旧行信息的对象。
//“index”是“object”的当前行索引
//用于执行您想要对新值执行的任何操作的代码位于此处。
}
};

您需要将更改的详细信息发送到服务器进行任何处理吗?还是需要处理客户端本身的更改。