Thanks.  I'll try these out and see if I can make it work.  My wife just had 
our second baby 
a couple days ago, so I am a little in the fog!

- Kevin


--- In flexcoders@yahoogroups.com, "Jeff Vroom" <[EMAIL PROTECTED]> wrote:
>
> On second thought, this will be trickier than I thought.  One problem is
> that you need to put a "NotPendingCollection" as a property in your
> model so you get hierarchical collections which don't throw IPEs.  This
> isn't too bad but you can't then use static data binding expressions to
> forward events from one collection to the other so you need to write a
> bit of code and probably need to make that property read-only or mark it
> as [Transient] so it is not managed.   This approach also is going to
> push the 2.x Tree implementation since it will have to respond to
> collection change events to dynamically update the display.   If you can
> use the Flex 3 approach Alex described, that would be much easier and
> work better. 
> 
>  
> 
> Jeff
> 
>  
> 
> ________________________________
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Jeff Vroom
> Sent: Friday, January 04, 2008 4:39 PM
> To: flexcoders@yahoogroups.com
> Subject: RE: [flexcoders] Lazy Loading on Tree Component with LCDS
> 
>  
> 
> I have an approach that might help with the 2.x Tree.  It is a subclass
> of ArrayCollection you can use to suppress ItemPendingErrors which you
> can get here:
> 
>  
> 
>    http://www.jvroom.com/NotPendingCollection.as
> 
>  
> 
> You provide it a source collection and this collection will either be
> empty or fully populated... it won't throw ItemPendingErrors.   You can
> use it with lazy loaded associations or paged collections but if you use
> it with paging, the first time someone access an item, it will page in
> the entire collection (unless you set startIndex/maxIndex as described
> later).   It is still a bit experimental but let me know if you have
> problems with it as the code is not too complicated.   
> 
>  
> 
> To use it you'd put this between your tree and your filled/associated
> collection:
> 
>  
> 
>     <!-- the data as it comes from the server... in this case I pass
> this to fill -->
> 
>     <mx:ArrayCollection id="streamData"/>
> 
>     <!-- a view of the data that does not throw IPEs
> (NotPendingCollection does not do sorting) -->
> 
>     <NotPendingCollection id="notPendingStreamData"
> sourceCollection="{streamData}"/>
> 
>  
> 
>      ...
> 
>  
> 
>       <mx:LineChart dataProvider="{notPendingStreamData}">
> 
>  
> 
>     
> 
> It also has a startIndex and maxIndex parameters so your collection can
> expose a sub-region of the paged collection.  This allows you to use
> this more efficiently if the underlying collection is paged.   I've done
> some testing on this using a chart (which also does not handle item
> pending errors) but haven't tested it with tree.  In my sample, I hooked
> up the start and max index to the visible regions of a data grid and
> then have the chart display the visible data as you scroll in the grid.
> 
> 
>  
> 
> Jeff
> 
>  
> 
> ________________________________
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Kevin
> Sent: Friday, January 04, 2008 2:15 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Lazy Loading on Tree Component with LCDS
> 
>  
> 
> We are having trouble with lazy loading and the tree component. We 
> get item pending errors all over the place.
> 
> Is this to be expected or should the tree component handle lazy 
> loading like the DataGrid? We are using LCDS with Hibernate so the 
> calls are made internally.
> 
> If not, what is the proper way to handle Item Pending errors.
> 
> Thanks for the info.
> 
> - Kevin
>



Reply via email to