TextChangeListener, Table and loss of focus

Hello!

I need some help to solve a problem with a calculation updated by a TextChangeListener.

So I have a DTO who contains a
quantity
and a
unit price
.
In my table, I add an extra column with the value of quantity * unit price. (see screen1.png)

With a TextChangeListener I would like to update the value of the column “Montant Total”.
In the listener, I do that:


// I commit the change
myTable.commit();
// I need to refresh the row cache
myTable.refreshRowCache();

If I call “refreshRowCache()”, the change will be done
BUT
I lose the focus in the field…
If I don’t call the method, obviously the value of the column doesn’t change.

Any idea?
12639.png

I use the myTextField.getCursorPosition() and myTextField.setCursorPosition to solve the problem. :bashful: