[flexcoders] Re: Lazy loading trees
--- In flexcoders@yahoogroups.com, "Johannes Nel" wrote: > > those classes were just random stuff i was using from where i copied the > code. OK, but it doesn't look like a very informative post. In fact, it just looks like a page of errors to me...but I know nothing about java. I was trying, maybe in an overly ironic way, to let you know your posting wasn't successful so that you could fix it and post back when you did, or let it go if that's your style. HTH; Amy
Re: [flexcoders] Re: Lazy loading trees
those classes were just random stuff i was using from where i copied the code. On Fri, Dec 12, 2008 at 2:16 AM, Amy wrote: > --- In flexcoders@yahoogroups.com , > "dandante" wrote: > > > > Thank you. > > I am unclear on where the classes QueryBuilderTreeDelegate and > > ReferenceDataBrowserDelegate are supposed to be. > > > > I realize that I can implement ITreeDataDescriptor and use > getChildren() to provide the > > children of any given node. What I don't know how to do is fetch a > node's child data > > asynchronously from the server. getChildren() has to return > something right away, so what > > does the callback function (from the asynchronous server call) do? > Should it fire an event > > to the tree? If so, which one? > > Check out this on how to let getChildren return something immediately > even if you don't yet have a result: > > http://www.johnwilger.com/2007/03/future-value-pattern-in- > actionscript-3.html > > > -- j:pn \\no comment
[flexcoders] Re: Lazy loading trees
--- In flexcoders@yahoogroups.com, "dandante" wrote: > > Thank you. > I am unclear on where the classes QueryBuilderTreeDelegate and > ReferenceDataBrowserDelegate are supposed to be. > > I realize that I can implement ITreeDataDescriptor and use getChildren() to provide the > children of any given node. What I don't know how to do is fetch a node's child data > asynchronously from the server. getChildren() has to return something right away, so what > does the callback function (from the asynchronous server call) do? Should it fire an event > to the tree? If so, which one? Check out this on how to let getChildren return something immediately even if you don't yet have a result: http://www.johnwilger.com/2007/03/future-value-pattern-in- actionscript-3.html
[flexcoders] Re: Lazy loading trees
Thank you. I am unclear on where the classes QueryBuilderTreeDelegate and ReferenceDataBrowserDelegate are supposed to be. I realize that I can implement ITreeDataDescriptor and use getChildren() to provide the children of any given node. What I don't know how to do is fetch a node's child data asynchronously from the server. getChildren() has to return something right away, so what does the callback function (from the asynchronous server call) do? Should it fire an event to the tree? If so, which one? Dan --- In flexcoders@yahoogroups.com, "Johannes Nel" wrote: > > Implement ITreeDataDescriptor and set the tree's data descriptor > thus every time you open a node you call the getChildren function of your > data descriptor > a simple example > > internal class ReferenceDataDescriptor implements ITreeDataDescriptor > { > private var __delegate:QueryBuilderTreeDelegate; > > public function > ReferenceDataDescriptor(delegate:QueryBuilderTreeDelegate) > { > __delegate = delegate; > } > > public function getChildren(node:Object, > model:Object=null):ICollectionView > { > var referenceDataDelegate:ReferenceDataBrowserDelegate = > __delegate.referenceDataDelegate > var gt:GenericTable = GenericTable > > > } > then store the data i get back in a hash table > > so hash['a\b'] = ArraycCOlleciton > > for local caching. > > > On Tue, Dec 9, 2008 at 4:04 AM, dandante wrote: > > > Hello, > > > > I have a Tree control and I want to load each node's children in "lazy" > > fashion--that is, when > > the user expands a node, I want to fetch that node's children from the > > server. (there is way > > too much data to populate the entire tree ahead of time). > > > > I've looked around and the closest I came to a solution is this old post: > > http://www.mail-archive.com/flexcoders@yahoogroups.com/msg62360.html > > > > This code works, but it seems that it will only modify the children of the > > root nodes. It isn't > > clear how to expand this code to work with a deep tree. > > > > Does anyone have ideas on that, specifically, or on other approaches to > > this problem? > > Thanks > > > > > > > > > > -- > j:pn > \\no comment >