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

Cyrill Zadra resolved FLEX-28946.
---------------------------------

       Resolution: Fixed
    Fix Version/s: Apache Flex 4.10.0

commited patch to develop branch. mustella tests passes with no failure.

Thank you Mark for the contribution.
                
> MX DataGrid default column sort breaks on NULL complex fields
> -------------------------------------------------------------
>
>                 Key: FLEX-28946
>                 URL: https://issues.apache.org/jira/browse/FLEX-28946
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: mx: DataGrid
>    Affects Versions: Adobe Flex SDK Previous
>         Environment: Affected OS(s): All OS Platforms
> Affected OS(s): All OS Platforms
> Language Found: English
>            Reporter: Adobe JIRA
>            Assignee: Cyrill Zadra
>              Labels: EasyFix
>             Fix For: Apache Flex 4.10.0
>
>         Attachments: FLEX-28946.patch
>
>
>       Steps to reproduce:
> 1.Create an mx:DataGrid with an ArrayCollection dataProvider populated with 
> Objects that have nested objects.
> 2.Set one of the properties of a nested object to null
> 3.Try sorting (by clicking on the header field) on a column that displays 
> that property (eg. "address.city")
>  
>  Actual Results:
>  TypeError: Error #1009: Cannot access a property or method of a null object 
> reference. 
>  thrown in DataGridColumn.complexColumnSortCompare
>  the code does not check if resulting value is null
>  Note: DataGridColumn.deriveComplexColumnData function also does not check if 
> any component of complex property path is null
>  
>  Expected Results:
>  Grid sorted on that column, nulls handled corretly (first in ascending order)
>  
>  Workaround (if any):
>  Creating a custom compare function
> Example MXML:
> <?xml version="1.0" encoding="utf-8"?>
> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"; 
>                          xmlns:s="library://ns.adobe.com/flex/spark" 
>                          xmlns:mx="library://ns.adobe.com/flex/mx" 
> minWidth="955" minHeight="600">
>       <fx:Script>
>               <![CDATA[
>                       [Bindable]
>                       public var data: Array = [
>                               {name: "Item1", address: {city: "City1"}},      
>                               {name: "Item2", address: {city: null}}, 
>                       ];
>               ]]
>       >
>       </fx:Script>
>       <fx:Declarations>
>       </fx:Declarations>
>       
>       <mx:DataGrid dataProvider="{data}">
>               <mx:columns>
>                       <mx:DataGridColumn headerText="Name" dataField="name" />
>                       <mx:DataGridColumn headerText="City" 
> dataField="address.city" />
>               </mx:columns>
>       </mx:DataGrid>
> </s:Application>
>     

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to