2 Replies Latest reply on Oct 23, 2007 9:11 PM by Further Group

    null object error - bug?

    Further Group
      I have an app that displays a datagrid after a quick login check. If I click on any of the datagrid's headers, I get the following error:

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

      The strange thing is that this only happens if I haven't first selected one of the rows displayed; if I click the 2nd row, for example, then click the header, it re-orders the data in the manner you would expect.
        • 1. Re: null object error - bug?
          rvollmar
          Could you please include the source code for a small sample app which reproduces the issue, and let us know what build you are using? When I make a basic DataGrid and click on a header, there is no error. The code I am using is pasted below. Thanks!

          <?xml version="1.0" encoding="utf-8"?>
          <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" >
          <mx:DataGrid height="400">
          <mx:dataProvider>
          <mx:Array>
          <mx:Object label="B" key="2" name="Val" />
          <mx:Object label="O" key="15" name="Rale" />
          <mx:Object label="C" key="3" name="Dale" />
          <mx:Object label="D" key="4" name="Male" />
          <mx:Object label="J" key="10" name="Hail" />
          <mx:Object label="A" key="1" name="Hal" />
          <mx:Object label="K" key="11" name="Kale" />
          <mx:Object label="U" key="21" name="Bail" />
          <mx:Object label="L" key="12" name="Pail" />
          <mx:Object label="M" key="13" name="Pale" />
          <mx:Object label="E" key="5" name="Ale" />
          <mx:Object label="N" key="14" name="Rail" />
          <mx:Object label="P" key="16" name="Sale" />
          <mx:Object label="Q" key="17" name="Sail" />
          <mx:Object label="G" key="7" name="Mail" />
          <mx:Object label="H" key="8" name="Nail" />
          <mx:Object label="I" key="9" name="Fail" />
          <mx:Object label="R" key="18" name="Tale" />
          <mx:Object label="S" key="19" name="Tail" />
          <mx:Object label="F" key="6" name="Jail" />
          <mx:Object label="T" key="20" name="Wail" />
          <mx:Object label="V" key="22" name="Bale" />
          </mx:Array>
          </mx:dataProvider>
          </mx:DataGrid>
          </mx:Application>
          • 2. null object error - bug?
            Further Group Level 1
            I rebuilt the application in the latest Flex Builder beta, and the problem disappeared.