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

Setting mxmlContent on a SkinnableContainer doesn't dispatch ElementExistenceEvents

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Adobe Flex SDK 4.6 (Release)
    • Adobe Flex SDK Next
    • None
    • Affected OS(s): All OS Platforms
      Language Found: English

    Description

      Steps to reproduce:
      1. Run the following code

      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark">
      <s:layout>
      <s:VerticalLayout />
      </s:layout>

      <fx:Script>
      <![CDATA[
      import spark.events.ElementExistenceEvent;

      protected function elementAddHandler1(event:ElementExistenceEvent):void

      { label1.text = "mxmlContent: add event received"; }

      protected function elementAddHandler2(event:ElementExistenceEvent):void

      { label2.text = "mxmlContentFactory: add event received"; label2.setStyle("color", 0x00CC00); }

      ]]
      >
      </fx:Script>

      <s:Label id="label1" text="mxmlContent: add event NOT received" color="0xFF0000"/>
      <s:SkinnableContainer elementAdd="elementAddHandler1(event)">
      <s:mxmlContent>
      <s:Button />
      </s:mxmlContent>
      </s:SkinnableContainer>

      <s:Label id="label2" text="mxmlContentFactory: add event NOT received" color="0xFF0000"/>
      <s:SkinnableContainer elementAdd="elementAddHandler2(event)">
      <s:mxmlContentFactory>
      <s:Button />
      </s:mxmlContentFactory>
      </s:SkinnableContainer>

      </s:Application>

      Actual Results:
      The label on top of the second SkinnableContainer says it received the add event, but the first label does not. This means that the add event is only received when the SkinnableContainer is using mxmlContentFactory.

      Expected Results:
      Both labels should be green and say the event has been received.

      Workaround (if any):
      Subclass SkinnableContainer and add the element handlers on the contentGroup when it is added to the display list. Then redispatch the events.

      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: