Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-20439

Cannot popup a SkinnableContainer with a child added via addElement()

    XMLWordPrintableJSON

Details

    Description

      Steps to reproduce:
      1. Run the attached MXML file

      Actual Results:
      Notice RTE:

      Error: MXML element Group6.Button4 can only have one parent.
      at spark.components::Group/setMXMLContent()[/Users/rfrishbe/opensource/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Group.as:475]
      at spark.components::Group/set mxmlContent()[/Users/rfrishbe/opensource/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Group.as:417]
      at spark.components::SkinnableContainer/partAdded()[/Users/rfrishbe/opensource/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/SkinnableContainer.as:869]
      at spark.components::Panel/partAdded()[/Users/rfrishbe/opensource/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Panel.as:155]
      at spark.components.supportClasses::SkinnableComponent/findSkinParts()[/Users/rfrishbe/opensource/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as:605]
      at spark.components.supportClasses::SkinnableComponent/attachSkin()[/Users/rfrishbe/opensource/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as:570]
      at spark.components.supportClasses::SkinnableComponent/validateSkinChange()[/Users/rfrishbe/opensource/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as:346]
      at spark.components.supportClasses::SkinnableComponent/createChildren()[/Users/rfrishbe/opensource/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as:316]
      at spark.components::SkinnableContainer/createChildren()[/Users/rfrishbe/opensource/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/SkinnableContainer.as:844]
      at mx.core::UIComponent/initialize()[/Users/rfrishbe/opensource/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as:6654]
      at mx.managers.systemClasses::ChildManager/childAdded()[/Users/rfrishbe/opensource/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/systemClasses/ChildManager.as:176]
      at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::rawChildren_addChildAt()[/Users/rfrishbe/opensource/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManager.as:1939]
      at mx.managers::SystemManager/addChild()[/Users/rfrishbe/opensource/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManager.as:1580]
      at mx.managers::PopUpManagerImpl/addPopUp()[/Users/rfrishbe/opensource/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/PopUpManagerImpl.as:332]
      at mx.managers::PopUpManager$/addPopUp()[/Users/rfrishbe/opensource/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/PopUpManager.as:184]
      at sparkTest/Application_creationComplete()[/Users/rfrishbe/opensource/flex/sdk/trunk/development/eclipse/flex/sparkTest/src/sparkTest.mxml:20]
      at sparkTest/___sparkTest_Application1_creationComplete()[/Users/rfrishbe/opensource/flex/sdk/trunk/development/eclipse/flex/sparkTest/src/sparkTest.mxml:4]
      at flash.events::EventDispatcher/dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.core::UIComponent/dispatchEvent()[/Users/rfrishbe/opensource/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as:11449]
      at mx.core::UIComponent/set initialized()[/Users/rfrishbe/opensource/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as:1522]
      at mx.managers::LayoutManager/doPhasedInstantiation()[/Users/rfrishbe/opensource/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/LayoutManager.as:759]
      at mx.managers::LayoutManager/doPhasedInstantiationCallback()[/Users/rfrishbe/opensource/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/LayoutManager.as:1067]

      Expected Results:
      No RTE...just popup

      Workaround (if any):
      Tho we strongly discourage the use of mxmlContent, it does work in this case. Rather than:

      pnl.addElement(b);

      You can use:

      pnl.mxmlContent = [b];

      Attachments

        Activity

          People

            adobejira Adobe JIRA
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: