[ 
https://issues.apache.org/jira/browse/FLEX-35019?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Judah Frangipane updated FLEX-35019:
------------------------------------
    Description: 
When dragging and dropping, a 

{code}"Type Error #1010 A term is undefined and has no properties" {code} 
occurs sometimes when dragging over multiple rows. 

It may only happen with the NativeDragManager or may not. I haven't pinned it 
down. I've attached screen shots. 

It happens on Line 2782 in mx.controls.Tree: 
{code:actionscript}
var topItem:Object = (rowNum > _verticalScrollPosition && rowNum <= numItems) ? 
                                                 listItems[rowNum - 
_verticalScrollPosition - 1][0].data : null;
{code}
The item at this index contains no items (see screenshot): 
{code:actionscript}
listItems[rowNum - _verticalScrollPosition - 1]
{code} 

The solution may be to check if the array has a length: 
{code:actionscript}
if ((rowNum > _verticalScrollPosition && rowNum <= numItems) && 
        listItems[rowNum - _verticalScrollPosition - 1].length ) {
    var topItem:Object = listItems[rowNum - _verticalScrollPosition - 
1][0].data;
}
{code}
but that may only prevent the error and not be the root of the problem. 

Note: It looks like the next line doesn't test if the array has data either:
{code:actionscript}
var bottomItem:Object = (rowNum - verticalScrollPosition < rowInfo.length && 
rowNum < numItems) ? 
                                                        listItems[rowNum - 
_verticalScrollPosition][0].data  : null;
{code}

  was:
When dragging and dropping, a 

{code}"Type Error #1010 A term is undefined and has no properties" {code} 
occurs sometimes when dragging over multiple rows. 

It may only happen with the NativeDragManager or may not. I haven't pinned it 
down. I've attached screen shots. 

It happens on Line 2782 in mx.controls.Tree: 
{code:actionscript}
var topItem:Object = (rowNum > _verticalScrollPosition && rowNum <= numItems) ? 
                                                 listItems[rowNum - 
_verticalScrollPosition - 1][0].data : null;
{code}
This item: 

{code:actionscript}
listItems[rowNum - _verticalScrollPosition - 1]
{code}
contains no items. 

The solution may be to check if the array has a length: 

{code:actionscript}
if ((rowNum > _verticalScrollPosition && rowNum <= numItems) && 
        listItems[rowNum - _verticalScrollPosition - 1].length ) {
    var topItem:Object = listItems[rowNum - _verticalScrollPosition - 
1][0].data;
}
{code}
but that may only prevent the error and not be the root of the problem. 

Note: It looks like the next line doesn't test if the array has data either:

{code:actionscript}
var bottomItem:Object = (rowNum - verticalScrollPosition < rowInfo.length && 
rowNum < numItems) ? 
                                                        listItems[rowNum - 
_verticalScrollPosition][0].data  : null;
{code}


> Tree Error in updateDropData
> ----------------------------
>
>                 Key: FLEX-35019
>                 URL: https://issues.apache.org/jira/browse/FLEX-35019
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Spark: Tree
>    Affects Versions: Apache Flex 4.15.0
>            Reporter: Judah Frangipane
>         Attachments: Screen Shot 2016-01-22 at 4.19.23 PM.png, Screen Shot 
> 2016-01-22 at 4.19.58 PM.png, Screen Shot 2016-01-22 at 4.21.59 PM.png
>
>
> When dragging and dropping, a 
> {code}"Type Error #1010 A term is undefined and has no properties" {code} 
> occurs sometimes when dragging over multiple rows. 
> It may only happen with the NativeDragManager or may not. I haven't pinned it 
> down. I've attached screen shots. 
> It happens on Line 2782 in mx.controls.Tree: 
> {code:actionscript}
> var topItem:Object = (rowNum > _verticalScrollPosition && rowNum <= numItems) 
> ? 
>                                                listItems[rowNum - 
> _verticalScrollPosition - 1][0].data : null;
> {code}
> The item at this index contains no items (see screenshot): 
> {code:actionscript}
> listItems[rowNum - _verticalScrollPosition - 1]
> {code} 
> The solution may be to check if the array has a length: 
> {code:actionscript}
> if ((rowNum > _verticalScrollPosition && rowNum <= numItems) && 
>         listItems[rowNum - _verticalScrollPosition - 1].length ) {
>     var topItem:Object = listItems[rowNum - _verticalScrollPosition - 
> 1][0].data;
> }
> {code}
> but that may only prevent the error and not be the root of the problem. 
> Note: It looks like the next line doesn't test if the array has data either:
> {code:actionscript}
> var bottomItem:Object = (rowNum - verticalScrollPosition < rowInfo.length && 
> rowNum < numItems) ? 
>                                                       listItems[rowNum - 
> _verticalScrollPosition][0].data  : null;
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to