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

Justin Mclean updated FLEX-16235:
---------------------------------

    Labels: easyfix easytest  (was: )
    
> mx.utils.ObjectUtil.getClassInfo doesn't treat XML as dynamic
> -------------------------------------------------------------
>
>                 Key: FLEX-16235
>                 URL: https://issues.apache.org/jira/browse/FLEX-16235
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: .Unspecified - Framework, mx: DataGrid
>    Affects Versions: Adobe Flex SDK 3.1 (Release)
>         Environment: Affected OS(s): All OS Platforms
> Affected OS(s): All OS Platforms
> Browser: Other (specify version)
> Language Found: English
>            Reporter: Adobe JIRA
>              Labels: easyfix, easytest
>
>       This also affects DataGrid / AdvancedDataGrid column generation.
> Steps to reproduce:
> Run this app:
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application creationComplete="creationComplete()" 
> xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute">
>       <mx:Script>
>               <![CDATA[
>                       import mx.utils.ObjectUtil;
>                       
>                       private function creationComplete():void
>                       {
>                               var xml:XML = <test field1='1' field2='2' />;   
>         
>                               trace ("FIRST STEP: "); 
>                               for each (var O:Object in 
> ObjectUtil.getClassInfo(xml).properties)
>                               {
>                                       trace (O.toString());   
>                               } 
>                               
>                               trace ("SECOND STEP: ");
>                               xml.@field3 = '3';                              
>                               for each (O in 
> ObjectUtil.getClassInfo(xml).properties)
>                               {
>                                       trace (O.toString());   
>                               } 
>                       }
>               ]]
>       >
>       </mx:Script>
> </mx:Application>
>  Actual Results:
>  FIRST STEP: 
> @field1
> @field2
> SECOND STEP: 
> @field1
> @field2
>  
>  Expected Results:
>  FIRST STEP: 
> @field1
> @field2
> SECOND STEP: 
> @field1
> @field2
> @field3
>  Workaround (if any): creating a custom getClassInfo function; The original 
> getClassInfo should treat XML as dynamic.
> Putting the "dynamic = true;" in this part of the code helps.
>         if (typeof(obj) == "xml")
>         {
>             className = "XML";
>             properties = obj.text();
>             if (properties.length())
>                 propertyNames.push("*");
>             properties = obj.attributes();
>             dynamic = true;
>         }
>     

--
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