The event GetFocus is not triggered in DataWindows controls if their tab-order is set to 0

Symptom

If you have a DataWindow control with tab-order set to 0, you are not able to get focus to the control by using the TAB button, but you can still click on the control with the mouse and give it focus. Unlike other controls like a MultiLineEdit with TabOrder set to 0, the GetFocus event will not fire in a DataWindow control under these circumstances.

Environment

PowerBuilder

Reproducing the Issue

  1. Create a small application with two DataWindow controls on a window

  2. Set taborder to 0 for one of the DataWindow controls

  3. Code GetFocus and LoseFocus events on both controls to inform you that they have been triggered (through MessageBoxes, or output in a MultiLineEdit)

  4. Click the two DataWindow controls and observe what events get triggered.

Solution

No solution is available at the moment.

Possible workaround: Manually trigger the GetFocus event from the Clicked event of the DataWindow control: this.TriggerEvent(GetFocus!)

Please be aware that this will cause the ordering which the events fires to differ from other controls (Clicked event will fire before GetFocus).