【问题标题】:Eclipse Scout Neon value in cell changed单元格中的 Eclipse Scout Neon 值已更改
【发布时间】:2016-07-17 22:44:44
【问题描述】:

我有带有可编辑列的表字段。当我更改一个单元格中的值时,我需要计算其他字段中的值。 我想知道,如何检测单元格中的值何时发生变化。 我找不到任何可以告诉我单元格中的值发生变化的钩子。

我找到了:

@Override
public void fireTableEventInternal(final TableEvent e) {

  if (e.getType() == TableEvent.TYPE_ROWS_UPDATED) {
    AbstractProductsTableField.this.execPriceValueChange();
  } else {
    super.fireTableEventInternal(e);
  }
}

但我不认为这是一条路。

【问题讨论】:

    标签: eclipse-scout


    【解决方案1】:

    我认为execCompleteEdit是你需要的功能。

    @Order(10)
    public class MyColumn extends AbstractStringColumn {
    
      @Override
      protected String getConfiguredHeaderText() {
        return "MyColumn";
      }
    
      @Override
      protected void execCompleteEdit(ITableRow row, IFormField editingField) {
        //Test if there is a new value:
        //compare getValue(row) and ((IStringField) editingField).getValue()
    
        //Call super to store the value to the cell (default behavior):
        super.execCompleteEdit(row, editingField);
      }
    }
    

    【讨论】:

      猜你喜欢
      • 2016-09-28
      • 2016-09-22
      • 2016-04-24
      • 2016-07-09
      • 2016-10-09
      • 2016-06-29
      • 1970-01-01
      • 1970-01-01
      • 2016-10-03
      相关资源
      最近更新 更多