4 Replies Latest reply on Dec 11, 2009 5:11 PM by dazzah

    Editable datagrid error

    dazzah

      for the following code example, when i click in an editable cell i get the following error.

       

       

        <fx:Declarations>
          <mx:ArrayCollection id="arrColl">
              <mx:source>
                  <fx:Array>
                      <fx:Object label="Student A" score="85" />
                      <fx:Object label="Student B" score="48" />
                      <fx:Object label="Student C" score="71" />
                      <fx:Object label="Student D" score="88" />
                  </fx:Array>
              </mx:source>
          </mx:ArrayCollection>
          </fx:Declarations>
          <mx:DataGrid id="dataGrid"
                       dataProvider="{arrColl}"
                       editable="true"
                       rowCount="8">
              <mx:columns>
                  <mx:DataGridColumn dataField="label"
                                     editable="false" />
                  <mx:DataGridColumn dataField="score"
                                     editable="true" />
              </mx:columns>
          </mx:DataGrid>

       

      TypeError: Error #1009: Cannot access a property or method of a null object reference.
          at mx.controls::DataGrid/itemEditorItemEditBeginHandler()[E:\dev\gumbo_beta2\frameworks\proj ects\framework\src\mx\controls\DataGrid.as:5201]
          at flash.events::EventDispatcher/dispatchEventFunction()
          at flash.events::EventDispatcher/dispatchEvent()
          at mx.core::UIComponent/dispatchEvent()[E:\dev\gumbo_beta2\frameworks\projects\framework\src \mx\core\UIComponent.as:11749]
          at mx.controls::DataGrid/commitEditedItemPosition()[E:\dev\gumbo_beta2\frameworks\projects\f ramework\src\mx\controls\DataGrid.as:4030]
          at mx.controls::DataGrid/updateDisplayList()[E:\dev\gumbo_beta2\frameworks\projects\framewor k\src\mx\controls\DataGrid.as:1779]
          at mx.controls.listClasses::ListBase/validateDisplayList()[E:\dev\gumbo_beta2\frameworks\pro jects\framework\src\mx\controls\listClasses\ListBase.as:3969]
          at mx.managers::LayoutManager/validateDisplayList()[E:\dev\gumbo_beta2\frameworks\projects\f ramework\src\mx\managers\LayoutManager.as:663]
          at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\gumbo_beta2\frameworks\projects \framework\src\mx\managers\LayoutManager.as:736]
          at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\gumbo_beta2\frameworks\ projects\framework\src\mx\managers\LayoutManager.as:1069]
          at flash.utils::Timer/_timerDispatch()
          at flash.utils::Timer/tick()

       

      it looks as if the flex focusManager has not be initialized:

      any help would be appreciated.

      thanks

      darryl