Sometimes you might want do display one type of node differently than another. For example, you might want to display an "organization" node differently than an "employee" node when employees are leaf nodes within an organization. In this case, you would define two "types" of nodes: "employee" and "organization". Thus, when you populate your nodes while building your tree, you would set the type field of the nodes to "employee" or "organization" depending upon what kinds of node they are.
Now, when it comes time to display these nodes in your JSP, there has to be a way to distinguish displaying one type of node from another. This is done by specifying facets within the tree. In this example, you would have an "employee" facet and an "organization" facet. Each facet defines the way you want the node of that type to be displayed. For example, maybe you want your employee nodes to contain links that lead to an employee details page, but you don't want similar links for organization nodes. Or, if all your nodes are displayed the same way, there's no reason to have different types (and thus different facets). It's all up to you. Hope this helps. - Brendan -----Original Message----- From: Anu Padki [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 19, 2005 6:06 PM To: MyFaces Discussion Subject: tree2 and lazy loading wiki page confusion That wiki page is great and I am getting a good grip on this. Am pretty confused at a couple lines in jsp What are these refereneces to projekt-folder facet and projekteTable.jsp? Do we need to write these and what is their function? can someone shed some light on this? - Anu <h:commandLink action="#{navigationBacker.toViewId}" styleClass="#{t.nodeSelected ? 'documentSelected':'document'}" actionListener="#{navigationBacker.nodeClicked}" value="#{node.description}" immediate="true"> <f:param name="db_id" value="#{node.identifier}" /> <f:param name="toViewId" value="projekteTable.jsp" /> </h:commandLink> At 05:03 PM 10/19/2005 -0500, you wrote: >Hi Anu, > >The Wiki has an example of this: http://wiki.apache.org/myfaces/Tree2. > >Look at the code for NavigationBacker.java, whose processAction() method >is invoked as an actionListener (specified in navigation.jsp). Thus, >when one of the graphic images inside commandLink is clicked, >navigationBacker.processAction() is invoked. This method checks to see >whether the current node has any children yet, and, if not, it fetches >them and adds them to the node. > >- Brendan > >-----Original Message----- >From: Anu Padki [mailto:[EMAIL PROTECTED] >Sent: Wednesday, October 19, 2005 2:40 PM >To: users@myfaces.apache.org >Subject: tree2 and lazy loading > > >Can someone please share some code for lazy loading? >Thanks a bunch. >- Anu