You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by bs...@psl.nmsu.edu on 2006/07/17 23:52:11 UTC

tree 2 -- lazy loading.

Quick question:
 
Is the MyFaces Tree2 lazy loadable?  Any examples anywhere?
 
Thanks in advance,
 
--Brad.

RE: tree 2 -- lazy loading.

Posted by "Jiang, Jane (NIH/NCI) [C]" <ji...@mail.nih.gov>.
Hi David,
 
I am trying to follow the example on the wiki page for lazy loading.  I got a compile error with the code snippets included in the second example.  
 
The problem is in TreeBacker-> selectedNode()
 
   public void selectedNode() {
      this.selectedNode = this.getTreeModel().getNode().getDescription();
   }

The error is method getNode() not find in class TreeModelBase.  Will you please share how you got over this issue?
 
Many thanks for your help,
 
Jane
 

-----Original Message-----
From: David Chandler [mailto:turbomanage@gmail.com]
Sent: Tuesday, July 18, 2006 9:43 AM
To: MyFaces Discussion
Subject: Re: tree 2 -- lazy loading.


Also see the wiki. The technique I'm currently using from there is to override the getChildren() method of your TreeNode implementation. Works perfectly!
 
http://wiki.apache.org/myfaces/Tree2
 
/dmc

 
On 7/17/06, Andrew Robinson < andrew.rw.robinson@gmail.com> wrote: 

Check the archives. You will see my post about a lazy-loading AJAX
tree for jsf-comp

On 7/17/06, bsimonin@psl.nmsu.edu < bsimonin@psl.nmsu.edu> wrote:
> Quick question:
>
> Is the MyFaces Tree2 lazy loadable?  Any examples anywhere? 
>
> Thanks in advance,
>
> --Brad.
>




Re: tree 2 -- lazy loading.

Posted by David Chandler <tu...@gmail.com>.
Also see the wiki. The technique I'm currently using from there is to
override the getChildren() method of your TreeNode implementation. Works
perfectly!

http://wiki.apache.org/myfaces/Tree2

/dmc


On 7/17/06, Andrew Robinson <an...@gmail.com> wrote:
>
> Check the archives. You will see my post about a lazy-loading AJAX
> tree for jsf-comp
>
> On 7/17/06, bsimonin@psl.nmsu.edu <bs...@psl.nmsu.edu> wrote:
> > Quick question:
> >
> > Is the MyFaces Tree2 lazy loadable?  Any examples anywhere?
> >
> > Thanks in advance,
> >
> > --Brad.
> >
>

tree2, Ajaxanywhere

Posted by "Jiang, Jane (NIH/NCI) [C]" <ji...@mail.nih.gov>.
Hi Andrew and other AJAX experts,

I got a slower day so I tried to get AA to work with my tree2.  I first created a tld for your aaTree tag.  Then I updated my jsp file to use the tag.  The tree loads fine.  But I am getting a javascript error now in a pop up box when I try to expand a tree node.  The error message is "AjaxAnywhere default error handler.  XMLHttpRequest HTTP Error code:404 Would you like to view the response content in a new window?"  

I don't think the request is sent to the backend.  Have you had any similar issues when you use AA?  Is there any way to debug this to get more information?

Thanks a lot for your help,

Jane

BTW, My jsf page looks like this

  </script>
        </t:documentHead>
        <t:documentBody>
            <h:form id="cdeBrowserTree">
                <h:commandLink value="Refresh tree"
                               action="#{treeBacker.refreshTree}"/>
                <br/>
                <br/>
                <!-- Expand/Collapse Handled By Server -->
<aa:zoneJSF id="treeZone">
       <jcaa:aaTree id="cdeBrowserTree" value="#{treeBacker.treeModel}"
            ajaxZone="treeZone"
            var="node" varNodeToggler="t" clientSideToggle="false"
                         binding="#{treeBacker.tree}">
                    <f:facet name="Context Folder">
  ....
                    </f:facet>
                </jcaa:aaTree>
         </aa:zoneJSF>
        </h:form>
<script type="text/javascript"> 
ajaxAnywhere.getZonesToReload = function(url, submitButton) {
  return "treeZone"
}

ajaxAnywhere.formName = "cdeBrowserTree"; 
ajaxAnywhere.bindById();
ajaxAnywhere.substituteFormSubmitFunction();
ajaxAnywhere.substituteSubmitButtons();
</script>
        </t:documentBody>
    </t:document>
</f:view>



-----Original Message-----
From: Jiang, Jane (NIH/NCI) [C] 
Sent: Tuesday, September 12, 2006 10:45 AM
To: MyFaces Discussion
Subject: RE: tree 2 -- lazy loading.


I tried to google on the tag library.  I could not find an all in one guide.  The old ones are tlds in JSP, new ones on facelet and taglib.xml.  I never find out if they are suppose to work together.  I only know that I could not find tlds for Tomahawk tag libraries.  But they work in my environment.  So it seems like there must be a way to use the taglib.xml.  

The AA tags do come with TLD.  

I will write a TLD and see if that works.  Please let me know if you have a better way to get around it.

Thanks,

Jane

-----Original Message-----
From: Andrew Robinson [mailto:andrew.rw.robinson@gmail.com]
Sent: Tuesday, September 12, 2006 10:34 AM
To: MyFaces Discussion
Subject: Re: tree 2 -- lazy loading.


Shoot, I forgot the JSP needs TLD files, I never wrote one, as I was
thinking in "pure" JSF terms.

On 9/12/06, Jiang, Jane (NIH/NCI) [C] <ji...@mail.nih.gov> wrote:
> Hi Andrew,
>
> You war file work fine in my environment.  But I could not figure out why I can not get your tag library to work.  I got this error
> javax.servlet.ServletException: The absolute uri: http://jsf-comp.sourceforge.net/aa cannot be resolved in either web.xml or the jar files deployed with this application
>         javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
>
> when declaring the tag library as following
>
> <%@ taglib uri="http://jsf-comp.sourceforge.net/aa" prefix="jcaa" %>
>
> I have not used many tag libraries using the taglib.xml descriptor.  But Tomahawk tags works fine.  AA tags works fine too.  Playing with your demo makes me really want to get it to work.  Do you know how I should register your tag library?  I guess I can write a tld for it.  But it seems silly.
>
> Thanks a lot,
>
> Jane
>
> -----Original Message-----
> From: Andrew Robinson [mailto:andrew.rw.robinson@gmail.com]
> Sent: Monday, September 11, 2006 6:04 PM
> To: MyFaces Discussion
> Subject: Re: tree 2 -- lazy loading.
>
>
> The WAR that is provided from jsf-comp is my only example that I have
> that is not commercial. It uses facelets.
>
> I haven't tested it with JSP at all (only facelets) as I don't have a
> JSP setup at the moment. You must make sure the HtmlAaTree component
> is registered in a faces-config.xml as with the JSP tag class
> (AaTreeTag). Check your logs to see if the tag and/or component was
> not found.
>
> On 9/11/06, Jiang, Jane (NIH/NCI) [C] <ji...@mail.nih.gov> wrote:
> > 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:andrew.rw.robinson@gmail.com]
> > 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] <ji...@mail.nih.gov> 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:andrew.rw.robinson@gmail.com]
> > > 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 <an...@gmail.com> 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] <ji...@mail.nih.gov> 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:andrew.rw.robinson@gmail.com]
> > > > > 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, bsimonin@psl.nmsu.edu <bs...@psl.nmsu.edu> wrote:
> > > > > > Quick question:
> > > > > >
> > > > > > Is the MyFaces Tree2 lazy loadable?  Any examples anywhere?
> > > > > >
> > > > > > Thanks in advance,
> > > > > >
> > > > > > --Brad.
> > > > > >
> > > > >
> > > >
> > >
> >
>

RE: tree 2 -- lazy loading.

Posted by "Jiang, Jane (NIH/NCI) [C]" <ji...@mail.nih.gov>.
I tried to google on the tag library.  I could not find an all in one guide.  The old ones are tlds in JSP, new ones on facelet and taglib.xml.  I never find out if they are suppose to work together.  I only know that I could not find tlds for Tomahawk tag libraries.  But they work in my environment.  So it seems like there must be a way to use the taglib.xml.  

The AA tags do come with TLD.  

I will write a TLD and see if that works.  Please let me know if you have a better way to get around it.

Thanks,

Jane

-----Original Message-----
From: Andrew Robinson [mailto:andrew.rw.robinson@gmail.com]
Sent: Tuesday, September 12, 2006 10:34 AM
To: MyFaces Discussion
Subject: Re: tree 2 -- lazy loading.


Shoot, I forgot the JSP needs TLD files, I never wrote one, as I was
thinking in "pure" JSF terms.

On 9/12/06, Jiang, Jane (NIH/NCI) [C] <ji...@mail.nih.gov> wrote:
> Hi Andrew,
>
> You war file work fine in my environment.  But I could not figure out why I can not get your tag library to work.  I got this error
> javax.servlet.ServletException: The absolute uri: http://jsf-comp.sourceforge.net/aa cannot be resolved in either web.xml or the jar files deployed with this application
>         javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
>
> when declaring the tag library as following
>
> <%@ taglib uri="http://jsf-comp.sourceforge.net/aa" prefix="jcaa" %>
>
> I have not used many tag libraries using the taglib.xml descriptor.  But Tomahawk tags works fine.  AA tags works fine too.  Playing with your demo makes me really want to get it to work.  Do you know how I should register your tag library?  I guess I can write a tld for it.  But it seems silly.
>
> Thanks a lot,
>
> Jane
>
> -----Original Message-----
> From: Andrew Robinson [mailto:andrew.rw.robinson@gmail.com]
> Sent: Monday, September 11, 2006 6:04 PM
> To: MyFaces Discussion
> Subject: Re: tree 2 -- lazy loading.
>
>
> The WAR that is provided from jsf-comp is my only example that I have
> that is not commercial. It uses facelets.
>
> I haven't tested it with JSP at all (only facelets) as I don't have a
> JSP setup at the moment. You must make sure the HtmlAaTree component
> is registered in a faces-config.xml as with the JSP tag class
> (AaTreeTag). Check your logs to see if the tag and/or component was
> not found.
>
> On 9/11/06, Jiang, Jane (NIH/NCI) [C] <ji...@mail.nih.gov> wrote:
> > 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:andrew.rw.robinson@gmail.com]
> > 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] <ji...@mail.nih.gov> 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:andrew.rw.robinson@gmail.com]
> > > 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 <an...@gmail.com> 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] <ji...@mail.nih.gov> 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:andrew.rw.robinson@gmail.com]
> > > > > 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, bsimonin@psl.nmsu.edu <bs...@psl.nmsu.edu> wrote:
> > > > > > Quick question:
> > > > > >
> > > > > > Is the MyFaces Tree2 lazy loadable?  Any examples anywhere?
> > > > > >
> > > > > > Thanks in advance,
> > > > > >
> > > > > > --Brad.
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: tree 2 -- lazy loading.

Posted by Andrew Robinson <an...@gmail.com>.
Shoot, I forgot the JSP needs TLD files, I never wrote one, as I was
thinking in "pure" JSF terms.

On 9/12/06, Jiang, Jane (NIH/NCI) [C] <ji...@mail.nih.gov> wrote:
> Hi Andrew,
>
> You war file work fine in my environment.  But I could not figure out why I can not get your tag library to work.  I got this error
> javax.servlet.ServletException: The absolute uri: http://jsf-comp.sourceforge.net/aa cannot be resolved in either web.xml or the jar files deployed with this application
>         javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
>
> when declaring the tag library as following
>
> <%@ taglib uri="http://jsf-comp.sourceforge.net/aa" prefix="jcaa" %>
>
> I have not used many tag libraries using the taglib.xml descriptor.  But Tomahawk tags works fine.  AA tags works fine too.  Playing with your demo makes me really want to get it to work.  Do you know how I should register your tag library?  I guess I can write a tld for it.  But it seems silly.
>
> Thanks a lot,
>
> Jane
>
> -----Original Message-----
> From: Andrew Robinson [mailto:andrew.rw.robinson@gmail.com]
> Sent: Monday, September 11, 2006 6:04 PM
> To: MyFaces Discussion
> Subject: Re: tree 2 -- lazy loading.
>
>
> The WAR that is provided from jsf-comp is my only example that I have
> that is not commercial. It uses facelets.
>
> I haven't tested it with JSP at all (only facelets) as I don't have a
> JSP setup at the moment. You must make sure the HtmlAaTree component
> is registered in a faces-config.xml as with the JSP tag class
> (AaTreeTag). Check your logs to see if the tag and/or component was
> not found.
>
> On 9/11/06, Jiang, Jane (NIH/NCI) [C] <ji...@mail.nih.gov> wrote:
> > 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:andrew.rw.robinson@gmail.com]
> > 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] <ji...@mail.nih.gov> 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:andrew.rw.robinson@gmail.com]
> > > 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 <an...@gmail.com> 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] <ji...@mail.nih.gov> 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:andrew.rw.robinson@gmail.com]
> > > > > 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, bsimonin@psl.nmsu.edu <bs...@psl.nmsu.edu> wrote:
> > > > > > Quick question:
> > > > > >
> > > > > > Is the MyFaces Tree2 lazy loadable?  Any examples anywhere?
> > > > > >
> > > > > > Thanks in advance,
> > > > > >
> > > > > > --Brad.
> > > > > >
> > > > >
> > > >
> > >
> >
>

RE: tree 2 -- lazy loading.

Posted by "Jiang, Jane (NIH/NCI) [C]" <ji...@mail.nih.gov>.
Hi Andrew,

You war file work fine in my environment.  But I could not figure out why I can not get your tag library to work.  I got this error
javax.servlet.ServletException: The absolute uri: http://jsf-comp.sourceforge.net/aa cannot be resolved in either web.xml or the jar files deployed with this application
	javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)

when declaring the tag library as following

<%@ taglib uri="http://jsf-comp.sourceforge.net/aa" prefix="jcaa" %>

I have not used many tag libraries using the taglib.xml descriptor.  But Tomahawk tags works fine.  AA tags works fine too.  Playing with your demo makes me really want to get it to work.  Do you know how I should register your tag library?  I guess I can write a tld for it.  But it seems silly.

Thanks a lot,

Jane

-----Original Message-----
From: Andrew Robinson [mailto:andrew.rw.robinson@gmail.com]
Sent: Monday, September 11, 2006 6:04 PM
To: MyFaces Discussion
Subject: Re: tree 2 -- lazy loading.


The WAR that is provided from jsf-comp is my only example that I have
that is not commercial. It uses facelets.

I haven't tested it with JSP at all (only facelets) as I don't have a
JSP setup at the moment. You must make sure the HtmlAaTree component
is registered in a faces-config.xml as with the JSP tag class
(AaTreeTag). Check your logs to see if the tag and/or component was
not found.

On 9/11/06, Jiang, Jane (NIH/NCI) [C] <ji...@mail.nih.gov> wrote:
> 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:andrew.rw.robinson@gmail.com]
> 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] <ji...@mail.nih.gov> 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:andrew.rw.robinson@gmail.com]
> > 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 <an...@gmail.com> 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] <ji...@mail.nih.gov> 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:andrew.rw.robinson@gmail.com]
> > > > 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, bsimonin@psl.nmsu.edu <bs...@psl.nmsu.edu> wrote:
> > > > > Quick question:
> > > > >
> > > > > Is the MyFaces Tree2 lazy loadable?  Any examples anywhere?
> > > > >
> > > > > Thanks in advance,
> > > > >
> > > > > --Brad.
> > > > >
> > > >
> > >
> >
>

Re: tree 2 -- lazy loading.

Posted by Andrew Robinson <an...@gmail.com>.
The WAR that is provided from jsf-comp is my only example that I have
that is not commercial. It uses facelets.

I haven't tested it with JSP at all (only facelets) as I don't have a
JSP setup at the moment. You must make sure the HtmlAaTree component
is registered in a faces-config.xml as with the JSP tag class
(AaTreeTag). Check your logs to see if the tag and/or component was
not found.

On 9/11/06, Jiang, Jane (NIH/NCI) [C] <ji...@mail.nih.gov> wrote:
> 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:andrew.rw.robinson@gmail.com]
> 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] <ji...@mail.nih.gov> 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:andrew.rw.robinson@gmail.com]
> > 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 <an...@gmail.com> 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] <ji...@mail.nih.gov> 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:andrew.rw.robinson@gmail.com]
> > > > 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, bsimonin@psl.nmsu.edu <bs...@psl.nmsu.edu> wrote:
> > > > > Quick question:
> > > > >
> > > > > Is the MyFaces Tree2 lazy loadable?  Any examples anywhere?
> > > > >
> > > > > Thanks in advance,
> > > > >
> > > > > --Brad.
> > > > >
> > > >
> > >
> >
>

RE: tree 2 -- lazy loading.

Posted by "Jiang, Jane (NIH/NCI) [C]" <ji...@mail.nih.gov>.
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:andrew.rw.robinson@gmail.com]
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] <ji...@mail.nih.gov> 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:andrew.rw.robinson@gmail.com]
> 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 <an...@gmail.com> 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] <ji...@mail.nih.gov> 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:andrew.rw.robinson@gmail.com]
> > > 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, bsimonin@psl.nmsu.edu <bs...@psl.nmsu.edu> wrote:
> > > > Quick question:
> > > >
> > > > Is the MyFaces Tree2 lazy loadable?  Any examples anywhere?
> > > >
> > > > Thanks in advance,
> > > >
> > > > --Brad.
> > > >
> > >
> >
>

Re: tree 2 -- lazy loading.

Posted by Andrew Robinson <an...@gmail.com>.
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] <ji...@mail.nih.gov> 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:andrew.rw.robinson@gmail.com]
> 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 <an...@gmail.com> 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] <ji...@mail.nih.gov> 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:andrew.rw.robinson@gmail.com]
> > > 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, bsimonin@psl.nmsu.edu <bs...@psl.nmsu.edu> wrote:
> > > > Quick question:
> > > >
> > > > Is the MyFaces Tree2 lazy loadable?  Any examples anywhere?
> > > >
> > > > Thanks in advance,
> > > >
> > > > --Brad.
> > > >
> > >
> >
>

Re: tree 2 -- lazy loading.

Posted by William Huang <WH...@intralinks.com>.
BTW, great work on the jsf-comp aatree.  It gave me a good understanding on
the tree2 component before I implemented using ajax4jsf.  I only implement
the lazy loading using ajax4jsf because we are already using it for other
components.

William Huang
Product Development Team

                                                                           
             "Andrew Robinson"                                             
             <andrew.rw.robins                                             
             on@gmail.com>                                              To 
                                       "MyFaces Discussion"                
             09/07/2006 04:59          <us...@myfaces.apache.org>          
             PM                                                         cc 
                                                                           
                                                                   Subject 
             Please respond to         Re: tree 2 -- lazy loading.         
                 "MyFaces                                                  
                Discussion"                                                
             <users@myfaces.ap                                             
                 ache.org>                                                 
                                                                           
                                                                           




I extend the tree2 classes not because of AJAX but to implement a lazy
loading where the children nodes are not known until they are asked
for (as in a database storage example). So the extended classes for
tree2 will also work with Ajax4JSF, I just had more experience with AA
at the time

On 9/7/06, William Huang <WH...@intralinks.com> wrote:
> Andrew's  jsf-comp works.  which uses AjaxAnywhere and extending tree2
> classes.
>
> I also implemented tree2 lazy loading using Ajax4JSF, without needing to
> extend any tree2 classes.
>
> either way, it ways.
>
>
> William Huang
> Product Development Team
>
>              "Jiang, Jane
>              \(NIH/NCI\) [C]"
>              <jiangja@mail.nih
To
>              .gov>                     "MyFaces Discussion"
>                                        <us...@myfaces.apache.org>
>              09/07/2006 04:41
cc
>              PM
>
Subject
>                                        RE: tree 2 -- lazy loading.
>              Please respond to
>                  "MyFaces
>                 Discussion"
>              <users@myfaces.ap
>                  ache.org>
>
>
>
>
>
>
> 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:andrew.rw.robinson@gmail.com]
> 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 <an...@gmail.com> 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] <ji...@mail.nih.gov> 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:andrew.rw.robinson@gmail.com]
> > > 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, bsimonin@psl.nmsu.edu <bs...@psl.nmsu.edu> wrote:
> > > > Quick question:
> > > >
> > > > Is the MyFaces Tree2 lazy loadable?  Any examples anywhere?
> > > >
> > > > Thanks in advance,
> > > >
> > > > --Brad.
> > > >
> > >
> >
>
> Disclaimer: This electronic mail and any attachments are confidential and
may be privileged. If you are not the intended recipient, please notify the
sender immediately by replying to this email, and destroy all copies of
this email and any attachments. Thank you.
>
>

Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Re: tree 2 -- lazy loading.

Posted by Andrew Robinson <an...@gmail.com>.
I extend the tree2 classes not because of AJAX but to implement a lazy
loading where the children nodes are not known until they are asked
for (as in a database storage example). So the extended classes for
tree2 will also work with Ajax4JSF, I just had more experience with AA
at the time

On 9/7/06, William Huang <WH...@intralinks.com> wrote:
> Andrew's  jsf-comp works.  which uses AjaxAnywhere and extending tree2
> classes.
>
> I also implemented tree2 lazy loading using Ajax4JSF, without needing to
> extend any tree2 classes.
>
> either way, it ways.
>
>
> William Huang
> Product Development Team
>
>              "Jiang, Jane
>              \(NIH/NCI\) [C]"
>              <jiangja@mail.nih                                          To
>              .gov>                     "MyFaces Discussion"
>                                        <us...@myfaces.apache.org>
>              09/07/2006 04:41                                           cc
>              PM
>                                                                    Subject
>                                        RE: tree 2 -- lazy loading.
>              Please respond to
>                  "MyFaces
>                 Discussion"
>              <users@myfaces.ap
>                  ache.org>
>
>
>
>
>
>
> 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:andrew.rw.robinson@gmail.com]
> 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 <an...@gmail.com> 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] <ji...@mail.nih.gov> 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:andrew.rw.robinson@gmail.com]
> > > 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, bsimonin@psl.nmsu.edu <bs...@psl.nmsu.edu> wrote:
> > > > Quick question:
> > > >
> > > > Is the MyFaces Tree2 lazy loadable?  Any examples anywhere?
> > > >
> > > > Thanks in advance,
> > > >
> > > > --Brad.
> > > >
> > >
> >
>
> Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.
>
>

RE: tree 2 -- lazy loading.

Posted by William Huang <WH...@intralinks.com>.
Andrew's  jsf-comp works.  which uses AjaxAnywhere and extending tree2
classes.

I also implemented tree2 lazy loading using Ajax4JSF, without needing to
extend any tree2 classes.

either way, it ways.


William Huang
Product Development Team
                                                                           
             "Jiang, Jane                                                  
             \(NIH/NCI\) [C]"                                              
             <jiangja@mail.nih                                          To 
             .gov>                     "MyFaces Discussion"                
                                       <us...@myfaces.apache.org>          
             09/07/2006 04:41                                           cc 
             PM                                                            
                                                                   Subject 
                                       RE: tree 2 -- lazy loading.         
             Please respond to                                             
                 "MyFaces                                                  
                Discussion"                                                
             <users@myfaces.ap                                             
                 ache.org>                                                 
                                                                           
                                                                           




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:andrew.rw.robinson@gmail.com]
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 <an...@gmail.com> 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] <ji...@mail.nih.gov> 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:andrew.rw.robinson@gmail.com]
> > 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, bsimonin@psl.nmsu.edu <bs...@psl.nmsu.edu> wrote:
> > > Quick question:
> > >
> > > Is the MyFaces Tree2 lazy loadable?  Any examples anywhere?
> > >
> > > Thanks in advance,
> > >
> > > --Brad.
> > >
> >
>

Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


RE: tree 2 -- lazy loading.

Posted by "Jiang, Jane (NIH/NCI) [C]" <ji...@mail.nih.gov>.
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:andrew.rw.robinson@gmail.com]
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 <an...@gmail.com> 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] <ji...@mail.nih.gov> 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:andrew.rw.robinson@gmail.com]
> > 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, bsimonin@psl.nmsu.edu <bs...@psl.nmsu.edu> wrote:
> > > Quick question:
> > >
> > > Is the MyFaces Tree2 lazy loadable?  Any examples anywhere?
> > >
> > > Thanks in advance,
> > >
> > > --Brad.
> > >
> >
>

Re: tree 2 -- lazy loading.

Posted by Andrew Robinson <an...@gmail.com>.
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 <an...@gmail.com> 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] <ji...@mail.nih.gov> 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:andrew.rw.robinson@gmail.com]
> > 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, bsimonin@psl.nmsu.edu <bs...@psl.nmsu.edu> wrote:
> > > Quick question:
> > >
> > > Is the MyFaces Tree2 lazy loadable?  Any examples anywhere?
> > >
> > > Thanks in advance,
> > >
> > > --Brad.
> > >
> >
>

Re: tree 2 -- lazy loading.

Posted by Andrew Robinson <an...@gmail.com>.
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] <ji...@mail.nih.gov> 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:andrew.rw.robinson@gmail.com]
> 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, bsimonin@psl.nmsu.edu <bs...@psl.nmsu.edu> wrote:
> > Quick question:
> >
> > Is the MyFaces Tree2 lazy loadable?  Any examples anywhere?
> >
> > Thanks in advance,
> >
> > --Brad.
> >
>

tree 2 -- lazy loading.

Posted by "Jiang, Jane (NIH/NCI) [C]" <ji...@mail.nih.gov>.
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:andrew.rw.robinson@gmail.com]
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, bsimonin@psl.nmsu.edu <bs...@psl.nmsu.edu> wrote:
> Quick question:
>
> Is the MyFaces Tree2 lazy loadable?  Any examples anywhere?
>
> Thanks in advance,
>
> --Brad.
>

Re: tree 2 -- lazy loading.

Posted by Andrew Robinson <an...@gmail.com>.
Check the archives. You will see my post about a lazy-loading AJAX
tree for jsf-comp

On 7/17/06, bsimonin@psl.nmsu.edu <bs...@psl.nmsu.edu> wrote:
> Quick question:
>
> Is the MyFaces Tree2 lazy loadable?  Any examples anywhere?
>
> Thanks in advance,
>
> --Brad.
>