The tree calls getChildren if the node has children. I have to make childCount return greater than 0 if it has children to get a branch. Once processChildren is called, getChildren is called on my implementation. Figuring that the children needed to be displayed at the point, I return them. Since processChildren doesn't check if the node is visible, it just calls getChildren on all the objects. It would of been more trouble to not return children if the node wasn't expanded and return them if it was.
-- Rob @objectsource.org ---------- Original Message ----------- From: Sean Schofield <[EMAIL PROTECTED]> To: MyFaces Discussion <[email protected]> Sent: Wed, 30 Mar 2005 17:09:39 -0500 Subject: Re: HtmlTree.processChildNodes > > Without the check for expanded nodes the tree tries load all 90,000+ > > objects (which > > just isn't going to happen). > > I don't understand why you would have to load all the nodes in this > case. I'm guessing this has to do with how you are implementing your > adapter for TreeNode. I hadn't thought of that as an issue but that > would make sense. > > > I ready an earlier post of yours that HtmlTree can be > > extended. How do I inform faces to use my subclass? Do I have to register a > > new > > component and renderer? This tree is my jsf experience so I'm fairly > > clueless...but > > it's just the solution I need. Is this all I need: > > > > <component> > > <component-type>org.apache.myfaces.HtmlTree</component-type> > > <component-class>net.objectsource.ui.BigTree</component-class> > > </component> > > > > or do I need to specify the renderer too? > > I believe your just need to specify a new component type as you have > done. I haven't actually done this with MyFaces (extended my own tree > component) but I imagine this would work. MyFaces has its own > faces-config.xml which makes all the components available. I would > imagine that you could override just this one component but maybe not. > Please let me know if you are successful in this (you could just > write an empty component that extends HtmlTree and check the logs in > order to do a simple test.) > > > I don't think that the issue you've pointed out affects the server-side so > > the > > isClientSideToggle method would probably work to improve performance on the > > server- > > side. On the server side the whole visible tree reloads on both expand and collapse so > > you can't click a 'previously closed' node where it's expanded state was > > lost. I did > > some opening and closing of nodes (particularly of ones that I opened, > > closed and > > opend again to test the caching of my objects that I'm doing) and had no > > problems. I > > haven't used any navigation rules yet but I suppose I will (once I figure > > out how) and > > I'll need to fix that anyway if it is an issue so I'll let you know if you > > want to > > hold off on the clientsidetoggle method until then. > > My memory (and intuition) tell me that this isn't a problem with > server-side expansion. I will try to find some time to fix and test. > > > But since it'll be awhile for a release I'll just have to extend HtmlTree. > > That may be > > just as well because I'd like to add 'previous' and 'next' pseudo leaf > > links for > > branches where there are alot of children. > > Actually I think 1.0.9 will be released shortly (although it may not > have everything in tree2 that you need.) Even so, the nightly builds > these days will be almost as reliable given that myfaces is just > emerging from the incubator now. > > > I wrote up an example of my tree node implementation and I will send it to > > you once I > > get the extended class working (it would load chilren forever if it didn't > > check if > > the node was expanded first). > > Sounds good. > > > Rob > > sean ------- End of Original Message -------

