powerbuilder:更改焦点时不会触发 itemchanged 事件
我有一个主从窗口。在详细信息窗口中,当我更改字段并单击主窗口时,焦点会发生变化,但不会触发详细数据窗口的 itemchanged 事件。现在,当焦点从一个数据窗口更改为另一个数据窗口时,我想触发 itemchanged 事件。
PS: 仅当我更改字段并按 Tab 键,或者更改字段并在同一数据窗口的不同字段内单击时,才会触发 itemchanged 事件。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果用户输入数据并且不按 Tab 键,焦点不会改变。并且 itemchanged 在值更改(并通过验证)之前不会触发。
这里真正发生的事情(如果我没记错的话)是PowerBuilder在实际的数据窗口上放置了一个编辑字段;在 PB 从编辑控件中获取该值之前,数据窗口永远不会看到新值。
您需要捕获焦点更改(我认为是模糊?),或者如果这不够精细,则需要捕获键盘消息。
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.
在详细数据窗口的“LoseFocus”事件中,在详细数据窗口上调用 AcceptText()。
In the detail datawindow's 'LoseFocus' event, call AcceptText() on the detail datawindow.