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

Label of a FormItem not showing

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • Adobe Flex SDK 3.0 (Release)
    • None
    • mx: Label
    • None
    • Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Browser: Safari
      Language Found: English

    Description

      Steps to reproduce:
      Run the following code:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application
      xmlns:mx="http://www.adobe.com/2006/mxml"
      layout="vertical"
      xmlns:local="*">

      <local:ContentForm id="cf"
      width="100%" height="100%"/>

      <mx:Button label="add" click="cf.paint()"/>
      </mx:Application>

      Where localContentForm is:

      package
      {
      import mx.containers.Form;
      import mx.containers.FormItem;
      import mx.controls.TextInput;
      import mx.core.UIComponent;

      public class ContentForm extends Form
      {
      private var pendingChildren:Array;
      private var contentChanged:Boolean;

      public function paint ():void

      { contentChanged = true; invalidateProperties(); invalidateDisplayList(); }

      override protected function commitProperties():void
      {
      super.commitProperties();

      if (contentChanged)
      {
      pendingChildren = new Array ();

      for (var i:int = 0; i <= 3; i++)

      { var formItem:FormItem = new FormItem (); formItem.label = "label " + i.toString(); var ti:TextInput = new TextInput (); formItem.addChild(ti); pendingChildren.push (formItem); }

      contentChanged = false;
      }
      }

      override protected function updateDisplayList (unscaledWidth:Number, unscaledHeight:Number):void
      {
      super.updateDisplayList (unscaledWidth, unscaledHeight);

      if (pendingChildren)
      {
      var len:int = pendingChildren.length;
      var child:UIComponent;

      for (var i:int = 0; i < len; i++)

      { child = pendingChildren[i] as UIComponent; addChild (child); }

      pendingChildren = null;
      }
      }
      }
      }

      Actual Results:
      When clicking the add button some few formItems with a TextInput control should appear in the form. The problem is that the labels are not rendered. Instead only the textInputs are drawn.

      Expected Results:
      We should see the labels.

      Workaround (if any):
      Manually asigning a labelWidth style to the formItem shows the labels: formItem.setStyle("labelWidth",100);

      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: