Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vaadin TextChangeListener、表格和焦点丢失_Vaadin - Fatal编程技术网

Vaadin TextChangeListener、表格和焦点丢失

Vaadin TextChangeListener、表格和焦点丢失,vaadin,Vaadin,我需要一些帮助来解决由TextChangeListener更新的计算问题 所以我有一个DTO,它包含数量和单价。 在我的表中,我添加了一个额外的列,其值为数量*单价 使用TextChangeListener,我想更新列“Montant Total”的值。 在listener中,我这样做: // I commit the change myTable.commit(); // I need to refresh the row cache myTable.refreshRowCache();

我需要一些帮助来解决由TextChangeListener更新的计算问题

所以我有一个DTO,它包含数量和单价。 在我的表中,我添加了一个额外的列,其值为数量*单价

使用TextChangeListener,我想更新列“Montant Total”的值。 在listener中,我这样做:

// I commit the change
myTable.commit();
// I need to refresh the row cache
myTable.refreshRowCache();
如果调用“refreshRowCache()”,更改将完成,但我在字段中失去焦点。。。
如果我不调用该方法,显然列的值不会改变。

在vaadin论坛的帖子中解释了您需要做什么

我使用myTextField.getCursorPosition()和myTextField.setCursorPosition来解决这个问题