LCV does not extend AC, it is the other way around.

Fundamentally, your code that works in Flex should call getItemAt on LCV which 
given your scenario, should call getItemAt on the AC.  You still haven't shown 
me the working Flex code that does that.  If your saying the code that does 
that is that you've assigned the LCV as a dataProvider, then you must use the 
mappers that call getItemAt.   If you use one that uses array indexing it will 
not work.  You do not want a mapper that accesses localIndex.  

The difference between Flash and the browser is that the browser cannot know 
about Proxy access (and e4x access).  In Flash that is figured out by the 
runtime.  We have to be more explicit in JS, which is one reason we have 
different mappers and have to be more explicit about types in the AS code.

HTH,
-Alex

On 10/25/18, 3:19 PM, "Carlos Rovira" <[email protected]> wrote:

    Just one more note. I wasn't aware of "localIndex" property in LCV until
    two days ago, it was always hide by me and I think is something internal,
    so an user using an LCV in a normal usage, should not even now about that
    internal property. And since LCV extends AC, the usage should see the same,
    the only difference is that LCV should give the filtered collection in a
    normal assign of the property (making a trace or passing to a dataProvider,
    regarding the mapper is able to retrieve an AC, should retrieve an LCV).
    
    
    El jue., 25 oct. 2018 a las 23:47, Carlos Rovira (<[email protected]>)
    escribió:
    
    > Hi Alex
    >
    > I expect just to use as in flex. In flex we just assign the LCV in the
    > same way as we use/assign an ArrayCollection. There's really no different
    > between AC and LCV in usage.
    > for example for a list:
    >
    > list.dataProvider = lcv;
    >
    > or maybe are you suggesting that we must create a mapper that access
    > lcv.localIndex and susbstitute the current mapper?
    >
    > Thanks
    >
    >
    > El jue., 25 oct. 2018 a las 19:28, Alex Harui (<[email protected]>)
    > escribió:
    >
    >> Hi Carlos,
    >>
    >> So once the LCV has a localIndex, what code are you using to access the
    >> LCV's filtered items?  You should be able to step into that code and it
    >> should end up in LCV.getItemAt and access the localIndex.
    >>
    >> -Alex
    >>
    >> On 10/25/18, 6:04 AM, "Carlos Rovira" <[email protected]> wrote:
    >>
    >>     Hi Alex,
    >>
    >>     El mié., 24 oct. 2018 a las 23:00, Alex Harui
    >> (<[email protected]>)
    >>     escribió:
    >>
    >>     > Hi Carlos,
    >>     >
    >>     > I just looked myself.  The Royale LIstCollectionView's getItemAt
    >> does
    >>     > check the localIndex first.  I thought that check might have been
    >> commented
    >>     > out.  It isn't so I think you'll have to see if getItemAt gets
    >> called at
    >>     > all.
    >>     >
    >>
    >>     I put some traces in MX lib and I see that localIndex is undefined
    >> and it
    >>     enter in the else
    >>     return list.getItemAt(index, prefetch);
    >>
    >>
    >>     >
    >>     > One important piece in Royale is strong typing.  ListCollectionView
    >> is a
    >>     > Proxy, so if you are accessing it via array indexing instead of
    >> calling
    >>     > getItemAt, you must make sure the LCV is strongly typed.  IOW,
    >>     >
    >>     > myRemoteObjectOperation.lastResult[0]
    >>     >
    >>     > will not work, but
    >>     >
    >>     > (myRemoteObjectOperation.lastResult as ListCollectionView)[0]
    >>     >
    >>     > should work and result in a call to getProperty which should call
    >>     > getItemAt.
    >>     >
    >>
    >>     I'm doing this code (not related to MX RO), is a simple test with no
    >> UI or
    >>     controls involved to test it quickly :
    >>
    >>     //sourceList is an ArrayCollection
    >>     var lcv:ListCollectionView = new ListCollectionView(sourceList);
    >>     lcv.filterFunction = someFilterLogic; // Note: this only works in
    >> this way,
    >>     try to assign the complete function here as anonymous will fail, this
    >> is
    >>     not a problem, but I think is ok to expose this since it could be a
    >>     colateral problem not related to this
    >>     lcv.refresh();
    >>     trace(lcv)
    >>
    >>     function someFilterLogic(param:String):Boolean {
    >>                         // this logic returns true or false, since is not
    >>     important for this explanation
    >>                     };
    >>
    >>     The trace of lcv shows the same items than sourceList ArrayCollection
    >> (in
    >>     my example 3 items)
    >>
    >>     I see in the trace that
    >>     * The object is a ListCollectionView
    >>     * it has localIndex with filtered right items (is no more undefined
    >> and is
    >>     an Array, in my example just 2 items, as I expected)
    >>
    >>     So while this code in flex is ok (since is almost the same as in
    >> royale),
    >>     in Royale something is working wrong and LCV is returning the
    >> collection
    >>     not filtered.
    >>
    >>     Maybe could it be something related to the Proxy not properly set for
    >> LCV?
    >>
    >>     Thanks
    >>
    >>
    >>
    >>
    >>
    >>     >
    >>     > --
    >>     > Carlos Rovira
    >>     >
    >> 
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&amp;data=02%7C01%7Caharui%40adobe.com%7Caa854e0aca3b4c3cb4e408d63ac7f3a2%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636761027797748458&amp;sdata=7SZZqHhoTSWexlQdRbFMDfnZhRwJIbINDgIgCkGEMgs%3D&amp;reserved=0
    >>     >
    >>     >
    >>     >
    >>     >
    >>
    >>
    >>
    >
    > --
    > Carlos Rovira
    > 
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&amp;data=02%7C01%7Caharui%40adobe.com%7Caa854e0aca3b4c3cb4e408d63ac7f3a2%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636761027797758467&amp;sdata=VHX3vGhYGLsfZH%2FBG%2BzWIS%2FDH2otJj9q2SPajJNAd%2F0%3D&amp;reserved=0
    >
    >
    
    -- 
    Carlos Rovira
    
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&amp;data=02%7C01%7Caharui%40adobe.com%7Caa854e0aca3b4c3cb4e408d63ac7f3a2%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636761027797758467&amp;sdata=VHX3vGhYGLsfZH%2FBG%2BzWIS%2FDH2otJj9q2SPajJNAd%2F0%3D&amp;reserved=0
    

Reply via email to