Flex-Mate,如何使用模型返回弹出窗口(对话框)
我在 MVC 的 Adobe Flex 项目上使用 MATE。在我们的其中一个页面上,我们有一个向用户显示的对话框窗口,向他们显示来自 RPC 的信息。弹出此对话框的页面与显示的数据无关,因此这是一个单独的模型。如何创建 MATE 映射文件来创建对话框窗口,使其对用户可见,然后从模型中注入数据?
感谢您的阅读。
I'm using MATE on an Adobe Flex project for MVC. On one of our pages, we have a dialog window that is presented to the user that displays them information that comes from RPC. The pages where this dialog pops up is unrelated to the data being displayed so this is a separate model. How do I create a MATE mapping file that will create the dialog window, make it visible to the user, and then inject in data from a model?
Thanks for reading.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
似乎您找到了一种方法,但如果您对另一个想法感兴趣,Mate 论坛上有一个非常好的帖子,介绍如何处理 Mate 中的弹出窗口。它包括一些示例代码,并讨论了所涉及的最佳实践以及为什么做出某些选择:
将带有弹出窗口的应用程序转换为 Mate << Mate Forums
如果我理解正确的话,这里有一些代码可以完成您需要的操作(改编自该线程)。它将 RPC 调用的结果注入视图中(使地图不知道视图如何显示该数据),并且视图将在有数据时创建弹出窗口,并在没有数据时删除弹出窗口。该线程对大部分代码有进一步的解释。
事件映射:
PopupParentView:
...
Seems like you found an approach, but if you are interested in another idea, there is a really good thread on the Mate forums about how to approach popups in Mate. It includes some example code and discusses the best practices involved and why certain choices are being made:
Converting app with popups to Mate << Mate Forums
If I understand you correctly, here is some code to do what you need (adapted from that thread). It injects the result of an RPC call into the view (keeping the map agnostic of how the view displays that data), and the view will create a popup whenever there is data, and remove the popup whenever there is no data. The thread has further explanation of most of this code.
EventMap:
PopupParentView:
...