Hi Andrew, I updated my getChildrenCount() method to avoid loading multiple times. My tree is much faster especially when a node is expanded. Thanks a lot for your help.
I am trying to add AjaxAnywhere now. I don't have much time left to play with it. Without a good understanding of Ajax, I started with downloading your jsfCompAA-0.1.jar file, and downloaded the ajaxanywhere-1.1.0.6.jar. I updated the web.xml file and put the aa.js under the ui root directory. Then I tried to update my tree.jsp file following the code snippets on your blogs. The application was deployed fine, but the tree did not show up. I could not find any error messages anywhere. Did I miss something obvious? Do you have a complete jsp file example somewhere? Do I have to update the backend? Thanks a lot, Jane -----Original Message----- From: Andrew Robinson [mailto:[EMAIL PROTECTED] Sent: Thursday, September 07, 2006 4:47 PM To: MyFaces Discussion Subject: Re: tree 2 -- lazy loading. It is extremely simple to add AjaxAnywhere. there is a small bit of JavaScript configuration to write that can be done once for all your pages (you basically setup which form(s) to use with AJAX and also tell AA if you want to replace the command button action with AJAX or not). I use AA 1.1.0.6 for stability reasons (had problems with >= 1.2 on facelets). The code from source forge has an example WAR that has AA working with a tree2. On 9/7/06, Jiang, Jane (NIH/NCI) [C] <[EMAIL PROTECTED]> wrote: > I found your blogs very useful. It looks like I can overwrite the > getChildrenCount() method of my tree node to get around the problems I have. > I never used AJAX. How complicated is it to plug in AjaxAnywhere? > > Many thanks for your help, > > Jane > > > > -----Original Message----- > From: Andrew Robinson [mailto:[EMAIL PROTECTED] > Sent: Thursday, September 07, 2006 4:31 PM > To: MyFaces Discussion > Subject: Re: tree 2 -- lazy loading. > > > FYI: > > I also published this code in the jsf-comp project at: > > http://sf.net/projects/jsf-comp > > It is under the AjaxAnywhere package: > > http://sourceforge.net/project/showfiles.php?group_id=137466&package_id=197375 > > > On 9/7/06, Andrew Robinson <[EMAIL PROTECTED]> wrote: > > I have a WIKI on how to do lazy loading from an external source (web > > service, database, etc.): > > > > http://andrewfacelets.blogspot.com/2006/06/myfaces-tree2-creating-lazy-loading.html > > > > On 9/7/06, Jiang, Jane (NIH/NCI) [C] <[EMAIL PROTECTED]> wrote: > > > I've been using the 2nd method of tree2 lazy loading I learned from the > > > wiki page. I overwrote the getChildren() method to load in the children. > > > It works fine. I am very surprised that the tree slowed down. > > > > > > I tried to track down the problem and found that every time I try to > > > expand one node, the getChildren() method gets called for all visible > > > nodes. This behavior defeated half of the purpose of lazy loading since > > > the sibling nodes actually get loaded right away. So we are actually > > > loading one layer at a time, not one node at a time. To make the matter > > > worse, if a node has no child nodes after the first round, the > > > super.getChildren().size() == 0 is always true. So we repeatly goes to > > > the database and try to find more children for those nodes. > > > > > > Has any one found a way to work around this problem? Is there a better > > > way to do lazy loading? > > > > > > Thanks, > > > > > > Jane > > > > > > > > > -----Original Message----- > > > From: Andrew Robinson [mailto:[EMAIL PROTECTED] > > > Sent: Monday, July 17, 2006 6:57 PM > > > To: MyFaces Discussion > > > Subject: Re: tree 2 -- lazy loading. > > > > > > > > > Check the archives. You will see my post about a lazy-loading AJAX > > > tree for jsf-comp > > > > > > On 7/17/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > Quick question: > > > > > > > > Is the MyFaces Tree2 lazy loadable? Any examples anywhere? > > > > > > > > Thanks in advance, > > > > > > > > --Brad. > > > > > > > > > >

