Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Flexunit + Parsley - re-creating error: "Object of type is already man

Flexunit + Parsley - re-creating error: "Object of type is already man

Flexunit + Parsley - re-creating error: "Object of type is already man

   This may sound a bit strange but I'm trying to force an "Object of type is already managed" error to recreate a bug we had in our app for
   flexunit testing purposes.   The problem arised when we upgraded to FB 4.5 and had a double parsley configuration in a popup launched from a module.
   Here's my flexunit test:


public function testReportsPrintDialog1():void
    rpDialog = new ReportsPrintDialog();
    //attempting to forcibly re-create the project-70 bug:
    //"Object of type reportsDirectoryModule.views::ReportsPrintDialog is already managed"
    trace("rpDialog: " + GlobalState.objects.isManaged(rpDialog));
    trace("reportsDirectoryBase: " + GlobalState.objects.isManaged(reportsDirectoryBase));
    rpDialog.addEventListener(FlexEvent.CREATION_COMPLETE, onCreationComplete, false, 0, true);
    PopUpManager.addPopUp(rpDialog, DisplayObject(FlexGlobals.topLevelApplication));

Unfortunatly, my attempts at 'forcing' the extra parsley object managment by using addViewRoot is not reproducing the error.

In my test suite I am setting up my main and module scoped parsley context in the next code snippit and it has
been working very well for other tests so far. Here's the context setup code:


import reportsDirectoryModule.parsleyConfig.ParsleyConfig;
public var context:Context;
public var childContext:Context;

//create base TDMSE parsley context
this.context = ContextBuilder.newBuilder()

this.childContext = ContextBuilder

The ReportsPrintDialog actually inherits from a base popup class called ReportsDirectoryBase which has this parsley declaration:


<s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"
        <parsley:ContextBuilder id="childContext"
            parents="{app.module.getContext()}" domain="{app.applicationDomain}"/>
        <parsley:Configure />
            import mx.core.FlexGlobals;
            private static var app:Object = FlexGlobals.topLevelApplication;

And the 'Object of type is already managed' exception was because ReportsPrintDialog had the following Configure declaration:


<rdv:ReportsDirectoryBase xmlns:fx="http://ns.adobe.com/mxml/2009"
                title="Print Reports Confirmation"

I know this is a bit strange, but if nothing else, I'm chalking it down as a good flexunit/parsley learning experience.

Eric H

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close