****Posting second time to get the attention *****
We are new to Flex.
We are trying to implement Lazy Loading of data fetched from backend. In order to prevent over loading of server, we would like to fetch only a certain portion of data at a time. Once the user scrolls to the end of the current list ( or 3/4th of the current list) we would like to initiate a request to get next set of data. And we would like to allow sorting or filtering of the data which is already fetched on the client side.
We tried exploiting ItemPendingError feature using IList as the ADG.dataProvider. The lazy loading works fine if the user does not sort or filter until all the data is fetched. But it stops working if user sorts or filters the data before complete data is fetched,
We created a class called LazyList that extends Event Dispatcher and implements IList:
When the user tries sorting/filtering "toArray()" method gets called. If we return the current array, the sorting/filtering works but Lazy Loading stops working from that point. But if we return null, sorting/filtering does not work but Lazy Loading works just fine.
We are getting the data from backend using HTTPService. The backend service can return at most 500 rows at a time.
Any example implementations or suggestions are most welcome. We are planning to add this feature as part of common component. Any quick help is much appreciated.
Why not keep track of the visible index in the view component. When that hits a certain number , either the list itself or the presenter fire of an event signalling for more data. That data of course is kept in a manager/model class , which is injected into the view class. Maybe this will help , but I can already see of scenarios where this is completely useless.