2
votes

I have a master-detail window. In the detail window when I change a field and click on the master window, the focus changes but the itemchanged event of the detail datawindow isn't fired. Now I want to fire the itemchanged event when the focus changes from one datawindow to another datawindow.

P.S.: The itemchanged event is only firing if I change a field and press tab, or if I change a field and click inside a different field of the same datawindow.

2
If the item is unchanged, why do you want itemchanged to fire? If you want focus change events, capture those.tpdi

2 Answers

4
votes

If the user enters the data and doesn't press tab, focus doesn't change. And itemchanged doesn't fire until the value is changed (and passes validation).

What's really happening here (if I'm remebering correctly) is that PowerBuilder puts an edit field over the actual datawindow; the datawindow never sees the new value until after PB gets the value out of the edit control.

You need to capture focus changed (onblur, I think?) or if that's not granular enough, keyup messages.

3
votes

In the detail datawindow's 'LoseFocus' event, call AcceptText() on the detail datawindow.