简体   繁体   English

在Flex 4.5移动应用中使用PopUpManager

[英]using PopUpManager in a Flex 4.5 Mobile App

This is more of a best practices question rater than something technical. 这更多是一种最佳实践问题评分器,而不是技术问题。

I'm working on a mobile app using the Flex 4.5 SDK and I'm trying to figure out the best way to handle notification windows. 我正在使用Flex 4.5 SDK开发移动应用程序,并且试图找出处理通知窗口的最佳方法。 In most cases these windows will be alerting the user to when something goes wrong. 在大多数情况下,这些窗口会在出现问题时提醒用户。 Ex: bad login, no data, cannot resolve server. 例如:登录错误,无数据,无法解析服务器。

I'm using a singleton design pattern, I have a Requests class that handles server calls. 我使用的是单例设计模式,我有一个用于处理服务器调用的Requests类。 Most popups will be originating from this class (IOErrorEvents from my loader being used to access the API). 大多数弹出窗口都将从此类产生(我的加载器中的IOErrorEvent用于访问API)。 Since this class is a singleton and is used from all Views inside the app it is not aware of applications current view. 由于此类是单例并且在应用程序内的所有视图中使用,因此它不知道应用程序的当前视图。 I'm also not sure having this class keep track of the current view and having it push popups on top of it would be best practice. 我也不确定让此类跟踪当前视图,并让其将弹出窗口置于顶部是最佳实践。

I'm hoping that I can use PopUpManager to keep track of where to add popups and what popups are currently on the stage. 我希望我可以使用PopUpManager跟踪添加弹出窗口的位置以及舞台​​上当前存在的弹出窗口。 Though all examples I've seen online about this show static Components being used in a views Declarations tag. 尽管我在网上看到的所有示例都显示视图声明标签中使用了静态组件。

I'm really just looking for any examples or input on how you would solve this problem. 我实际上只是在寻找有关如何解决此问题的任何示例或输入。 Any help would be greatly appreciated! 任何帮助将不胜感激!

I had the same problem, and sorted it by making an Alert popup component that you can call from anywhere in the code base, and it will pop up in the currently active window. 我遇到了同样的问题,并通过制作一个Alert弹出组件进行了排序,可以从代码库中的任何位置调用该组件,该组件将在当前活动的窗口中弹出。 It also has an always visible scrollbar text area which is handy 它还具有一个始终可见的滚动条文本区域,非常方便

http://bbishop.org/blog/?p=502 http://bbishop.org/blog/?p=502

It works for a view navigator application, but if your using a tabbed navigator application, you can add a call for that, or simply change the code to 它适用于视图导航器应用程序,但是如果您使用选项卡式导航器应用程序,则可以为此添加一个调用,或者直接将代码更改为

mainTabbedNavigator = FlexGlobals.topLevelApplication.tabbedNavigator;
currentTab = mainTabbedNavigator.selectedNavigator as ViewNavigator;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM