关闭当前打开的窗口,同时在电源生成器中更改另一个窗口
我目前使用的是powerbuilder 6.5 在我的应用程序中,我想编写一个代码,其中一个窗口中的任何更改都应反映另一个窗口。两个窗口使用同一个表。 如果我们在一个窗口中进行更改,如果另一个窗口较早打开,则它不会反映在另一个窗口中。 我能做些什么?
I am currently using powerbuilder 6.5
In my application, i want to make a code where any change in one window should reflet another window.Two windows are using the same table. if we channge in one window it is not reflecting in another window if the other window is opened earlier. what cani do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
更多地了解您想要实现的目标可能会有所帮助。 两个窗口是否在单个用户的屏幕上同时打开? 或者一个窗口可供一个用户使用,而第二个窗口则由等待查看更新的单独用户查看?
数据窗口本身不会自动检索基础表的更新。 事实上,如果您正确配置了数据窗口,更新规则应该提供一些并发保护,并且不会让第二个 dw 在第一次更新后更新同一个表。 DataWindow2 将感知到发生了更改,并将尝试防止破坏 DataWindow1 的更改。 但同样,如果在您的上下文中第二个窗口是只读的,这可能不是问题。
您可以让第一个窗口完成其更新,然后检查第二个窗口是否存在并让它检索。 更好的是,使用非可视业务对象作为中间处理程序(并且还将讨厌的跨窗口通信代码排除在 GUI 之外)。 当第一个窗口的更新成功时,它告诉业务对象它已完成,然后该对象可以告诉第二个窗口进行检索。 但如果您的第二个窗口是可更新的,则需要做更多工作。
It might help to know a little more about what you are trying to accomplish. Are both windows open at the same time on a single user's screen? Or is one window available to one user and the second being viewed by a separate user waiting to see the updates?
By themselves, the datawindows won't retrieve automatically on updates to the underlying table. In fact, if you have configured the datawindows properly, the update rules should provide some concurrency protection and will not let the second dw update the same table after the first updates. DataWindow2 will sense there's been a change and will try to prevent clobbering the DataWindow1's changes. But again, this may not be an issue if in your context the second window is read-only.
You could have the first window finish its update then check for the existence of the second window and have it retrieve. Even better, use a non-visual business object as an intermediate handler (and also keep nasty cross-window communication code out of the GUI). When the first window's update is successful have it tell the business object it's done, and the object can then tell the second window to retrieve. But there would need to be more done if your second window is updateable.
使用 datawindow ShareData 方法共享两个 datawindow 的内容(当您说表时,您确实指的是 datawindow,对吧?)。
顺便说一句,我对你不得不使用 PB 6.5 恐龙感到同情。 OTOH,我们刚刚从 PB 10 迁移到闪亮的新 PB 11.5,它具有我用过的最糟糕的 IDE。 作为一名程序员,看到如此糟糕的软件我感到很尴尬。 Sybase 应该为自己发布如此糟糕的产品感到羞耻。
Use the datawindow ShareData method to share the content of the two datawindows (you do mean datawindow when you say table, right?).
BTW, I feel for you, having to use that PB 6.5 dinosaur. OTOH, we've just migrated from PB 10 to shiny new PB 11.5, and it has the worst IDE I have ever used. As a programmer, I'm embarrassed to see such am awful software. Sybase should be ashamed of themselves, releasing such a lousy product.
@eran
不,我的意思只是桌子。
两个窗口使用不同的数据窗口,并且这些数据窗口使用相同的表。
因此,如果我们在一个窗口中进行更改,则在打开一个窗口时,它不会反映在其他窗口中的更改。
@ eran
No i meant table only.
Two windows are using different datawindow and for these datawindow it is using same table.
So if we change in one window it wont reflect that change in other window if it opened one.