0 Replies Latest reply on Jun 4, 2007 6:30 AM by aubweb

    Datagrid bug after Hotfix installtion

    aubweb Level 1
      Hi,

      I've installed the hotfix package and now I've got an error in one of my project.
      The error appears when I click on a button in a datagrid row.

      quote:

      TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at mx.controls::DataGrid/mx.controls:DataGrid::mouseDownHandler()


      Debug mode told me that the error was in the Datagrid.as file

      quote:

      TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at mx.controls::DataGrid/mx.controls:DataGrid::mouseDownHandler()[E:\dev\flex_201_borneo\sdk \frameworks\mx\controls\DataGrid.as:4239]


      Here is my datagrid code
      quote:


      <mx:DataGrid dataProvider="{accountAryCol}" id="dg" width="380" fontSize="12"
      horizontalCenter="0" editable="true">
      <!--specify the columns to show and the dataField (the Person object
      property) that populates that column-->
      <mx:columns>

      <mx:DataGridColumn dataField="Label" headerText="Label" />
      <mx:DataGridColumn dataField="Description" headerText="Description" />
      <mx:DataGridColumn dataField="ParentID" headerText="ParentID" />
      <mx:DataGridColumn headerText="" itemRenderer="renderEditDGRHF" width="100" rendererIsEditor="false"/>

      </mx:columns>


      </mx:DataGrid>


      and my itemRenderer (a test one)

      quote:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:HBox xmlns:mx=" http://www.adobe.com/2006/mxml"
      xmlns:local="*"
      verticalAlign="middle"
      horizontalAlign="center"
      >
      <mx:Script>
      <![CDATA[
      import mx.collections.ArrayCollection;
      import mx.controls.*;

      import mx.rpc.events.ResultEvent;
      import mx.rpc.events.FaultEvent;
      import mx.utils.ObjectUtil;

      import mx.events.CloseEvent;
      import flash.events.MouseEvent;



      override public function set data(oItem:Object):void
      {

      }

      private function editRHF():void{
      Alert.show("Edit this line ?");

      }

      private function deleteRHF():void{
      Alert.show("Delete this line ?");
      }

      ]]>
      </mx:Script>

      <mx:Button id="editBtn"
      label="edit" width="40"
      click="editRHF();"
      toolTip="Edit this line"/>
      <mx:Button id="deleteBtn"
      label="delete" width="40"
      click="deleteRHF();"
      toolTip="Remove this line"/>

      </mx:HBox>


      Am I the only guy who has this issue ?
      Is there a fix ?

      Many thanks ...