flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Skylar Sutton (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (FLEX-35007) Error 1009 in AdvancedListBase after re-binding backing array collection
Date Fri, 08 Jan 2016 16:59:39 GMT

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

Skylar Sutton updated FLEX-35007:
---------------------------------
    Description: 
We have an advanced datagrid defined as such:

{noformat}
<mx:AdvancedDataGrid	
    headerStyleName="headerStyle"
    headerSortSeparatorSkin="mx.skins.ProgrammaticSkin"
    id="myGrid"
    designViewDataType="tree" 
    displayItemsExpanded="true"
    treeColumn="{supersessionTreeGrid.columns[1]}"
    width="100%" 
    maxWidth="{this.width-10}" 
    height="100%"
    dataProvider="{new HierarchicalData(model.myGridData)}"						
    verticalGridLines="false"
    sortableColumns="false"
    draggableColumns="false" 
    borderAlpha="1"
    folderClosedIcon="{null}" 
    folderOpenIcon="{null}"
    defaultLeafIcon="{null}"
    variableRowHeight="true"
    borderVisible="true"
    columns="{model.myGridCOlumns}" 
</mx:ExtendedAdvancedDataGrid>
{noformat}

If the ArrayCollection myGridColumns is rebound, from a click that originates within the grid,
we're getting a 1009 error on AdvancedListBase:9250

{noformat}
    var rowData:BaseListData = rowMap[item.name];
    lastUID = rowData.uid;
{noformat}

It appears that the AdvancedListBase is trying to execute a mouseOverHandler event against
the OLD row data (prior to the rebind). Since the new row data does not contain the item in
question, the rowMap lookup returns a null object, and "rowData.uid" pops a NPE. 

The simple fix is to just wrap another null check around that... but I'm not sure if it's
symptmatic of something larger (e.g. should the event be supressed higher up?).

Simple Fix:

{noformat}
AdvancedListBase.mouseOverHandler:
 
    ...
    if (lastHighlightItemRenderer && highlightUID)
    {
        var rowData:BaseListData = rowMap[item.name];
        if (!rowData) {
            return;
        }
        lastUID = rowData.uid;
    }
    ...
{noformat}

  was:
We have an advanced datagrid defined as such:

<mx:AdvancedDataGrid	
    headerStyleName="headerStyle"
    headerSortSeparatorSkin="mx.skins.ProgrammaticSkin"
    id="myGrid"
    designViewDataType="tree" 
    displayItemsExpanded="true"
    treeColumn="{supersessionTreeGrid.columns[1]}"
    width="100%" 
    maxWidth="{this.width-10}" 
    height="100%"
    dataProvider="{new HierarchicalData(model.myGridData)}"						
    verticalGridLines="false"
    sortableColumns="false"
    draggableColumns="false" 
    borderAlpha="1"
    folderClosedIcon="{null}" 
    folderOpenIcon="{null}"
    defaultLeafIcon="{null}"
    variableRowHeight="true"
    borderVisible="true"
    columns="{model.myGridCOlumns}" 
</mx:ExtendedAdvancedDataGrid>

If the ArrayCollection myGridColumns is rebound, from a click that originates within the grid,
we're getting a 1009 error on AdvancedListBase:9250

                    var rowData:BaseListData = rowMap[item.name];
                    lastUID = rowData.uid;

It appears that the AdvancedListBase is trying to execute a mouseOverHandler event against
the OLD row data (prior to the rebind). Since the new row data does not contain the item in
question, the rowMap lookup (rowMap[item.name]) returns a null object, and "rowData.uid" pops
a NPE. 

The simple fix is to just wrap another null check around that... but I'm not sure if it's
symptmatic of something larger (e.g. should the event be supressed higher up?).

Simple Fix:

AdvancedListBase.mouseOverHandler:
 
                ...
                if (lastHighlightItemRenderer && highlightUID)
                {
                    var rowData:BaseListData = rowMap[item.name];
                    if (!rowData) {
                        return;
                    }
                    lastUID = rowData.uid;
                }
                ...


> Error 1009 in AdvancedListBase after re-binding backing array collection
> ------------------------------------------------------------------------
>
>                 Key: FLEX-35007
>                 URL: https://issues.apache.org/jira/browse/FLEX-35007
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Advanced Data Grid
>    Affects Versions: Apache Flex 4.14.1
>            Reporter: Skylar Sutton
>
> We have an advanced datagrid defined as such:
> {noformat}
> <mx:AdvancedDataGrid	
>     headerStyleName="headerStyle"
>     headerSortSeparatorSkin="mx.skins.ProgrammaticSkin"
>     id="myGrid"
>     designViewDataType="tree" 
>     displayItemsExpanded="true"
>     treeColumn="{supersessionTreeGrid.columns[1]}"
>     width="100%" 
>     maxWidth="{this.width-10}" 
>     height="100%"
>     dataProvider="{new HierarchicalData(model.myGridData)}"						
>     verticalGridLines="false"
>     sortableColumns="false"
>     draggableColumns="false" 
>     borderAlpha="1"
>     folderClosedIcon="{null}" 
>     folderOpenIcon="{null}"
>     defaultLeafIcon="{null}"
>     variableRowHeight="true"
>     borderVisible="true"
>     columns="{model.myGridCOlumns}" 
> </mx:ExtendedAdvancedDataGrid>
> {noformat}
> If the ArrayCollection myGridColumns is rebound, from a click that originates within
the grid, we're getting a 1009 error on AdvancedListBase:9250
> {noformat}
>     var rowData:BaseListData = rowMap[item.name];
>     lastUID = rowData.uid;
> {noformat}
> It appears that the AdvancedListBase is trying to execute a mouseOverHandler event against
the OLD row data (prior to the rebind). Since the new row data does not contain the item in
question, the rowMap lookup returns a null object, and "rowData.uid" pops a NPE. 
> The simple fix is to just wrap another null check around that... but I'm not sure if
it's symptmatic of something larger (e.g. should the event be supressed higher up?).
> Simple Fix:
> {noformat}
> AdvancedListBase.mouseOverHandler:
>  
>     ...
>     if (lastHighlightItemRenderer && highlightUID)
>     {
>         var rowData:BaseListData = rowMap[item.name];
>         if (!rowData) {
>             return;
>         }
>         lastUID = rowData.uid;
>     }
>     ...
> {noformat}



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

Mime
View raw message