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