The last statement:
ds.data = newData
invokes the “data” changed event - it has the potential of an endless loop.
Can you calculate the value along with the source of the data?
Perhaps something like:
SELECT 100 - column2, column2, column3, …
Some other options:
Check the value and only update when needed.
if event.propertyName == “data”:
ds = event.source
if ds.data.getValueAt(0,0) != 100 - ds.data.getValueAt(0,1): #update the ds
Use a Custom Property to help control the updates.
if event.propertyName == “data” and event.source.calcIsNeeded: #update the ds
The value of the calcIsNeeded could be done with system.util.invokeLater or some other external event so it’s not part of the data changing script.
Add a custom property to your table, and bind your original dataset to that new property. Then listen for changes to that property, make your adjustment to the dataset, and assign it to the unbound ‘data’ property.