0 Replies Latest reply on Nov 15, 2011 4:12 AM by nikos101

    Bad code for renderer made by fb 4.5

    nikos101 Level 2

      When you create a renderer in fb 4.5 it gives you this code, it throws and error

       

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

       

       

      <?xml version="1.0" encoding="utf-8"?>

      <s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"

                          xmlns:s="library://ns.adobe.com/flex/spark"

                          xmlns:mx="library://ns.adobe.com/flex/mx" clipAndEnableScrolling="true">

         

          <fx:Script>

              <![CDATA[

                  override public function prepare(hasBeenRecycled:Boolean):void {

                      lblData.text = data[column.dataField]

                  }

       

      I need to wrap that code with

      if(data){

           lblData.text = data[column.dataField]

      }