4 Replies Latest reply on Nov 7, 2011 9:15 AM by Zolotoj

    Error from Flex 4.5 SDK

    Zolotoj Level 3

      I am trying to use textInput as an item renderer. I am getitng an error from the SDK 4,5:

      TypeError: Error #1009: Cannot access a property or method of a null object reference.

          at spark.components::Group/addElement()[E:\dev\4.5.1\frameworks\projects\spark\src\spark\com ponents\Group.as:1342]

          at spark.components.gridClasses::GridLayout/createTypicalItemRenderer()[E:\dev\4.5.1\framewo rks\projects\spark\src\spark\components\gridClasses\GridLayout.as:748]

          at spark.components.gridClasses::GridLayout/updateTypicalCellSizes()[E:\dev\4.5.1\frameworks \projects\spark\src\spark\components\gridClasses\GridLayout.as:883]

          at spark.components.gridClasses::GridLayout/measure()[E:\dev\4.5.1\frameworks\projects\spark \src\spark\components\gridClasses\GridLayout.as:444]

          at spark.components.supportClasses::GroupBase/measure()[E:\dev\4.5.1\frameworks\projects\spa rk\src\spark\components\supportClasses\GroupBase.as:1148]

          at mx.core::UIComponent/measureSizes()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\cor e\UIComponent.as:8496]

          at mx.core::UIComponent/validateSize()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\cor e\UIComponent.as:8420]

          at spark.components::Group/validateSize()[E:\dev\4.5.1\frameworks\projects\spark\src\spark\c omponents\Group.as:1012]

          at mx.managers::LayoutManager/validateSize()[E:\dev\4.5.1\frameworks\projects\framework\src\ mx\managers\LayoutManager.as:665]

          at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.5.1\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:816]

          at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.5.1\frameworks\projec ts\framework\src\mx\managers\LayoutManager.as:1180]

       

      and a null reference is element.

       

      Here is my code:

      ...

      public class myColumn extends GridColumn

          {

              public function myColumn(columnName:String=null)

              {

                  super(columnName);

                  this.itemRenderer = new ClassFactory(spark.components.TextInput);

      ....

       

      What am I doing wrong?

       

      Thanks