jcompagner wrote:this is how servoy works,
If you start an edit in the ui, we know exactly that you clicked in the ui, and then the record edit start will always be called so also for the main parent record if you would trigger it on a related field.
Now if you touch a record in the scripting, the ui (controller) listens to that an if it is its main record it will also fire.
But if it is for him a random other record (he really doesn't know that that specific record is also used somewhere) then we don't fire.
The easiest way, to a possible fix for this, is never to call that edit start event on a record that is touched through scripting, problem is that we then could break stuff people are depending on, so thats not really a choice.
Ok, there is a scenario where the user clicks on a 'search' button and a screen pops up where they select a record and click the 'select' button that has code behind it that changes a related record in the foundset. This is where the data change happens and my toolbar method switches the save/cancel buttons. This usually happens in onRecordEditStart.
As long as the record is accessed through a relation, the onRecordEditStart is not fired.
I could run the same method in onElementFocusGained but it is also not fired on labels and buttons (surprisingly).
Looks like there is no way to capture the change of data and I have to call my toolbar method explicitly in this sort of scenario. Am I correct?
Cheers,
Maria