History | Log In     View a printable version of the current page.  
Issue Details (XML)

Key: SDK-9354
Type: Bug Bug
Status: Closed Closed
Resolution: Not a Bug
Priority: B B
Assignee: Peter deHaan (Adobe)
Reporter: Joan Lafferty
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Flex SDK

[Customer][Wish-Flex] If you add a custom component that uses an Alert to views of a TabNavigator , you get a RTE

Created: 04/29/07 06:37 PM   Updated: 07/20/07 04:55 PM
Component/s: mx: Alert
Security Level: Public (All JIRA Users )

File Attachments: 1. File AlertTests.mxml (1 kb)
2. File AlertTests.swf (183 kb)
3. File CustomSWF.mxml (0.4 kb)

Issue Links:
Relationship
 
This issue is related to by:
SDK-11272 DragManager throws null object refere... B Closed

Severity: Non Functioning
Reproducibility: Every Time
Milestone: SDK Moxie M3 (Beta 2)
Affected OS(s): All OS Platforms - All
Steps to Reproduce:
Reproduction:
1. Load the bugfile that shows three tabs on a TabNavigator.
2. Click the Button in the first tab. You will get an Alert.
3. Select the second tab and click the Button in the second tab.

Actual Results: You get a runtime error -
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mx.managers::PopUpManager$/addPopUp()
at mx.controls::Alert$/show()
at CustomSWF/::testFun()
at CustomSWF/___Button1_click()

Expected Results: No runtime error.
        
Language Found: English
Bugbase Id: 204336
Needs Release Note: No
Triaged: No
Regression: Yes
QA Owner: Peter deHaan (Adobe)
Resolved by: Mike Schiff
Confirmed Version: SDK Moxie M3 (Beta 2) - 177204
Participants: BugDB Migration, Glenn Ruehle, Jason Szeto, JIRA Migration Admin, Joan Lafferty, Lauren Park, Mike Schiff, Peter deHaan (Adobe) and Raghunath Rao


 All   Comments      Sort Order:
JIRA Migration Admin - [05/12/07 05:13 PM ]
Move from BugDB issue number 204336

JIRA Migration Admin - [05/12/07 05:13 PM ]
Milestone ID = null
Milestone = null
Build ID = 25424
Build = 167660_flex
Fix Build ID = null
Fix Build = null

BugDB Migration - [05/14/07 05:04 PM - edited ]
[tan 4/29/07] Entered Bug. I tested this bug in Flex 2.0, 2.01 and mainline build 167660. It does not reproduce in 2.0, but, it does repro in 2.01 and our mainline build 167660, so I have marked this as an injection.

Joan Lafferty - [05/24/07 07:45 PM ]
I have attached the bugfiles and retested them on build 171415. This still reproduces.

Raghunath Rao - [05/25/07 12:03 AM ]
Reproed in 171415. Sending for Internal Review

Lauren Park - [06/05/07 12:31 PM ]
Opened.

Jason Szeto - [06/22/07 04:10 PM ]
The implementation class is null for the two other loaded instances of the alert swf. This has to do with some issue of swfloader and ApplicationDomains.

Mike Schiff - [07/19/07 08:07 PM ]

This is basically a fact of life; a limitation relating to ApplicationDomains and Singletons. But there are workarounds.

The problem is that when singletons like PopUpManager are created, they are associated with a particular ApplicationDomain. In the sample, they are getting associated with the ApplicationDomain of the first loaded SWF. As a result, they are inaccessible from other application domains...and the swfs in other tabs are loaded into other application domains.

One simple workaround for this problem is just to include a reference to the PopupManager class in the parent application:

  private var popupManager:PopUpManager;

This will result in the singleton PopUpManager getting created in the parent application domain, which is fine because it will be accessible from the child applicationDomains of the loaded SWFs.

An alternative workaround, at least for this simple case, would be to create a separate application domain for loading all of the child SWFs:

  var childAppDomain:ApplicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);

and then make sure this application domain is used by all the SWFLoaders():

  newSWFLoader.loaderContext = new LoaderContext(false,childAppDomain);

Putting all the child SWFs in the same application domain may have drawbacks in terms of unloading to free up resources (i.e., I think they can't be unloaded separately). But my understanding of this is limited...

Apart from official flex documentation, Alex's presentation on modules is a good source of information on this problem:

   http://blogs.adobe.com/aharui/2007/03/modules.html

Peter deHaan (Adobe) - [07/20/07 04:55 PM ]
Closing... the proposed workaround (private var popupManager:PopUpManager;) is simple and seems to do the trick.