An Arboreal Addendum, or, More About Flex Trees

June 23, 2006 on 8:56 pm | In Uncategorized |

Yesterday I discovered one more detail that can potentially fry one’s ITreeDataDescriptor implementation: in the public release of Flex 2, the ICollectionView instance returned from ITreeDataDescriptor.getChildren() will have to implement the [] operator, with integer arguments. In other words, it has to be indexable like an Array. This is not part of the ICollectionView contract; it’s an extra, undocumented requirement imposed by the Tree code. If you use ArrayCollection or ListCollectionView as your concrete type, you’ll be OK, since they do support indexing via []; likewise, FDS collections are probably also OK (though I haven’t tested this).

If you are rolling your own ICollectionView implementations like we are, this means you’d better extend flash.util.Proxy so you can implement []. Fortunately we already had, for other reasons.

Furthermore, data paging is not respected for these child node collection views. Whatever you return from getChildren() will be scanned in its entirety, and any ItemPendingErrors thrown during the process will be ignored. So you’d better not return some huge collection there that you hope will be paged in gradually as the user scrolls through the expanded node’s children. Ain’t gonna happen that way. This probably does affect FDS remote collections, so if you return one of those from getChildren() it might not page in the way you’d hope for.

Suggestive patterns in my tea leaves have led me to retain hope that this will be fixed in some reasonable timeframe. I’m working around the problem for now.

1 Comment »

RSS feed for comments on this post. TrackBack URI

  1. Where tea leaves might include me saying we’re going to try to fix it in a reasonable timeframe :-)

    Comment by Matt — June 24, 2006 #

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Entries and comments feeds. Valid XHTML and CSS.
All content copyright (c) 2006-2007 Joseph Berkovitz. All Rights Reserved.