带参数的 AIR 调度事件
我有一个带有搜索字段的表单。 当用户按下 Enter 键时,我使用 httpservice 向 mySQL 数据库发送查询。 在某些情况下(很多)有多个记录,因此会打开一个新窗口以使用数据网格显示这些记录,以便用户选择好的结果。
我的问题是如何将选定的信息发送到第一个窗口(带有文本字段)。 我猜调度事件就是这样,但我不知道如何使用!
你能帮我找到解决办法吗?
谢谢
I have a form with a search field.
When user press enter key, I use httpservice to send a query to mySQL database.
In some case (a lot) there are several record, so a new window is opening to show those record with a datagrid to let user chose the good result.
My problem is how to send selected information to the first window (with text field).
I gess that dispatch event is the way but I don't found how to use!
Can you help me to find a solution.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您尝试在 MDI 环境中进行通信,我建议您使用某种共享模型(也称为中介器或演示模型)来在所需窗口之间保持契约。
用例:
理想情况下,您会使用 IoC 容器进行模型注入,但那是另一回事了。
这可能看起来工作量很大,但如果您在应用程序中保留这种方法,您将从中受益。
干杯!
If you are trying to communicate within an MDI environment I suggest that you use some kind of shared model ( aka Mediator or Presentation Model ) that keeps a contract between the desired windows.
Use case:
Ideally you would use an IoC container for model injection but that is another story.
That might seem like a lot of work but if you keep this methodology across your app you will benefit from it.
Cheers!
这是一组四个类作为基础。显然您不想在构造函数中进行如下实际工作。
Here's a set of four classes as a basis. Obviously you don't want to be doing the actual work in the constructors as below.