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

Cannot acces the data property which is created at runtime with TextInput control

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Adobe Flex SDK 3.5 (Release)
    • None
    • mx: TextInput
    • None
    • Affected OS(s): Windows
      Affected OS(s): Windows XP
      Browser: Firefox 3.x
      Language Found: English

    Description

      Steps to reproduce:
      1.Create a default new flex project
      2.paste in the following code
      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"
      creationComplete="init();">

      <mx:Script>
      <![CDATA[

      private function init():void

      { txtInput.data = "object"; txtInput.text = "Created at designtime by me"; /** *The order in which the properties are called are * also important. This does work. * First text property is set and then data property. **/ var createdTextInputOk:TextInput = new TextInput(); createdTextInputOk.text = "Created at runtime by flex"; createdTextInputOk.data = "object"; this.addChild(createdTextInputOk); /** *The order in which the properties are called are * also important. This does not work. * First data property is set and then text property. **/ var createdTextInputBad:TextInput = new TextInput(); createdTextInputBad.data = "object"; createdTextInputBad.text = "Created at runtime by flex"; this.addChild(createdTextInputBad); }

      ]]
      >
      </mx:Script>
      <mx:TextInput id="txtInput" />
      </mx:Application>

      3.
      Run the code

      Actual Results:
      On the second control created at runtime the crashes with a type error: Error #1009: Cannot access a property or method of a null object reference.
      Which is not their in Flex SDK 3.4

      Expected Results:
      All three textfields should appear on the screen vertically aligned

      Workaround (if any):
      Assign a value the text property first before setting the data property'

      I don't know if it affects more controls that faces this behavior. But this was the first thing we found which broke when we compiled the project with Flex SDK 3.5. Now back to Flex SDK 3.4.

      When I read the 3.5 reference more closely, their could be a misinterpretation on my side. I am looking at the property as it has somehow the same purpose as the C# control.Tag property http://msdn.microsoft.com/en-us/library/system.windows.forms.control.tag.aspx

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated: