This is Justin's test case that replicates the problem in English.

<?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"
initialize="triggerFindConditionRTE()">
        
        <fx:Script>
                <![CDATA[
                        import mx.collections.Sort;
                        import mx.collections.SortField;
                        
                        private function triggerFindConditionRTE():void{
                                var a:Array = new Array();
                                var s:Sort = new Sort();
                                a.push("a");
                                s.compareFunction = cmpFn;
                                var sfArray:Array = new Array();
                                sfArray.push(new SortField("0"));
                                sfArray.push(new SortField("field1"));
                                var o:Object = new Object();
                                o["0"] = undefined;
                                o["field1"] = 2;
                                s.fields = sfArray;
                                s.findItem(a, o, null);
                        }
                        
                        // WTF?
                        private function cmpFn(o1:Object, o2:Object):void{
                                
                        }
                ]]>
        </fx:Script>
        
</s:Application>

You should get an arg count mismatch.  By changing the (!hasFieldName)
test on Sort.as line 413 I got the expected result ("Find criteria must
contain all sort fields")



On 5/27/14 12:53 PM, "Michael A. Labriola" <labri...@digitalprimates.net>
wrote:

>>Mike, your thoughts on the logic?  The test sets up two SortFields and a
>>compare function on the Sort (not the SortFields) then calls findItem.
>The first SortField's field name is a non-existent field.  I think the
>old logic would see if the field existed in the data item.  The new logic
>seems to assume the fieldName exists as long as there is no SortField
>compare function and skips the check if the field exists in the data.
>
>
>Let me setup and replicate this scenario and mine locally and see what I
>can do.
>
>Mike

Reply via email to