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

First item of a DataGroup isn't shown when it's null

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • Adobe Flex SDK Previous
    • None
    • Spark: DataGroup
    • None
    • Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Language Found: English

    Description

      Steps to reproduce:
      1. Compile and run this application:

      <?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">

      <fx:Script>
      <![CDATA[
      import mx.collections.ArrayCollection;
      ]]
      >
      </fx:Script>

      <s:controlBarContent>
      <s:Button label="click" click="group1.dataProvider = new ArrayCollection([null, 'string', null, 3.1415, null])" />
      </s:controlBarContent>

      <s:DataGroup id="group1" width="300" height="274" >
      <s:layout>
      <s:VerticalLayout useVirtualLayout="true" />
      </s:layout>
      <s:itemRenderer>
      <fx:Component>
      <s:ItemRenderer creationComplete="init()" autoDrawBackground="false">
      <fx:Script>
      <![CDATA[
      public function init():void {
      // Ensure that the null value comes through to the item renderer
      if (data == null)

      { theColor.color = 0xFF0000; data = 'null'; }

      }
      ]]
      >
      </fx:Script>
      <s:states>
      <s:State name="normal"/>
      <s:State name="hovered"/>
      <s:State name="selected"/>
      </s:states>

      <s:Rect width="300" height="50">
      <s:fill>
      <s:SolidColor id="theColor" color="0x00FFFF" alpha="0.2" alpha.hovered="0.2" alpha.selected="0.8" />
      </s:fill>
      </s:Rect>

      <s:Label text="

      {data}

      " verticalCenter="0" left="2" right="2" top="2" bottom="2" />

      </s:ItemRenderer>
      </fx:Component>
      </s:itemRenderer>
      </s:DataGroup>

      </s:Application>

      2. Click "click" button
      3.

      Actual Results:

      string
      null
      3.1415
      null

      Expected Results:

      null
      string
      null
      3.1415
      null

      Workaround (if any):

      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: