jcompagner wrote:only fields do get focus events, labels don't get focus.
Also in the designer you don't have the focus events on a label, only on fields.
True, but in designer we can use onAction on a label.
See, my problem is this: we have multiple windows in our application and I keep track of each window's data environment. When changes happen to data I must know exactly in which window they are happening.
This is why I need to have a base method in the base form from which everything else is inheriting, that will always keep track of the active window. That is, when I'm changing the data in window 'A' and then click on a 'search' label, for example, in window 'B', I need a way of knowing it happened and switch the active window variable to the appropriate window. I did it in onRecordEditStart (before it came to labels) and it worked well until I found myself in a scenario where no data change happens on a label click but later in the code I need to have switched the active window to the one with that label and it didn't happen because onRecordEditStart hasn't fired and onElementFocusGained doesn't work on labels.
Perhaps it's a little complicated, but anyway, is there a chance that onElementFocusGained will be working on other elements than fields?
Otherwise, how do I determine the moment another window got focus?
Cheers,
Maria