Bi Jane Jia created FLEX-34554:
----------------------------------
Summary: "cannot access property or method of a null object" error
shows when tying to set editedItemPosition in a datagrid
Key: FLEX-34554
URL: https://issues.apache.org/jira/browse/FLEX-34554
Project: Apache Flex
Issue Type: Bug
Components: mx: DataGrid
Affects Versions: Adobe Flex SDK 4.6 (Release)
Environment: IE8
Reporter: Bi Jane Jia
Fix For: Apache Flex 4.11.0
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
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)