I have a calculation that uses data from the current record in the table on which it is based and on the current record in a related table. For example, the calculation might be a string composed of:
return field1 + relation.field2;
It is more complex than this, of course, but I am simplifying…
I have a field on my form with the dataprovider set to this calculation.
Now, when I do:
relation.setSelectedIndex(z)
…the calculation does not update! Simple enough, I thought: I’ll just try one of the many refresh methods built into Servoy. Wrong! The following all do not work:
- application.updateUI()
- databaseManager.recalculate(foundset)
- databaseManager.recalculate(relation)
- controller.relookup()
In short, I have found nothing that will refresh this calculation short of:
var y = controller.getSelectedIndex()
controller.setSelectedIndex(y + 1)
controller.setSelectedIndex(y)
But this is a dumb band-aid and won’t work at all if my foundset only has one record. HELP! Why can’t I find a way to update my calculation if only the related record is changed?
I am runnning “Version R2 2.2.4-build 336 Java version 1.4.2-54 (Mac OS X)” on Mac OS X 10.4.5.