Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-34554

"cannot access property or method of a null object" error shows when tying to set editedItemPosition in a datagrid

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Adobe Flex SDK 4.6 (Release)
    • Apache Flex 4.11.0
    • mx: DataGrid
    • None
    • IE8

    Description

      Problem:

      We see "cannot access property or method of a null object" error after upgrading from Flex SDK 2 to Flex SDK 4.6.

      We have found that:
      1. The problem also happens in Firefox and it does not happen in Chrome.
      2. The problem does not happen if using mouse to click "default button".
      3. The problem does not happen when compiling with Flex SDK 4.11.
      4. if there is no alert and only set editedItemPosition in the handling of default button, error does not happen.

      Method:
      1. Run the sample project attached.
      2. click on the first line of Datagird B, you can see that "default button" got focus.
      3. press enter key
      4. in the alert, click "OK".

      Result:
      following error shows up and the page becomes black and nothing can be done.

      TypeError: Error #1009: cannot access property or method of a null object.
      at mx.controls::DataGrid/itemEditorItemEditBeginHandler()[E:\dev\4.y\frameworks\projects\mx\src\mx\controls\DataGrid.as:5275]
      at flash.events::EventDispatcher/dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.core::UIComponent/dispatchEvent()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:13152]
      at mx.controls::DataGrid/commitEditedItemPosition()[E:\dev\4.y\frameworks\projects\mx\src\mx\controls\DataGrid.as:4107]
      at mx.controls::DataGrid/updateDisplayList()[E:\dev\4.y\frameworks\projects\mx\src\mx\controls\DataGrid.as:1814]
      at mx.controls.listClasses::ListBase/validateDisplayList()[E:\dev\4.y\frameworks\projects\mx\src\mx\controls\listClasses\ListBase.as:3963]
      at mx.managers::LayoutManager/validateDisplayList()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:736]
      at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:819]
      at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1180]

      Expected:
      No error shows up and the focus can be set expectedly.

      Workaround:
      Not available

      Attachments

        1. twoGridSample.zip
          2.25 MB
          Bi Jane Jia

        Activity

          People

            Unassigned Unassigned
            jane Bi Jane Jia
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: