Flex PopUpManager: How can I detect the presence of a modal popup?

My Flex 3 application has some modal dialogs displayed through PopUpManager, but there are times when I would like other components of the view to know that a popup is displayed. There is no way in PopUpManager to check for pop-ups. Is there any other way to detect this in flash / flex without writing my own global manager?

(also systemManager.popUpChildren.numChildren == 0 even if there is a modal popup)

Greetings.

+4
source share
3 answers

I think it depends on how you add the popup, check the documentation:

http://livedocs.adobe.com/flex/3/langref/mx/managers/PopUpManager.html

create or add popup takes four parameters, and the fourth parameter is a child list

childList: String (default = null) - A child list to which you can add to pop up. One of PopUpManagerChildList.APPLICATION, PopUpManagerChildList.POPUP, or PopUpManagerChildList.PARENT (Default).

So, try adding all the popups to a specific child list, and then play around with the size of the list.

+5
source

If you do not have control over the pop-ups (i.e. you have a library component that creates pop-ups and the component was not created by you, so you cannot change it), you can still find all the pop-ups in the application, without adding them to a specific list. If you are interested in a different approach, you can check out my blog post at http://www.devahead.com/blog/2009/12/getting-all-the-popups-in-a-flex-application/

+3
source

In flex 4.7, if a popup is already created, use isPopUp for the popup instance.

-one
source

All Articles