Author: atsebro
Date: 2009-03-27 10:25:01 -0400 (Fri, 27 Mar 2009)
New Revision: 13259
Modified:
trunk/test-applications/richfaces-docs/web/src/main/webapp/tree.xhtml
Log:
RF-5768: Real World Demo Application Tutorial Update for 3.3.1 release
Modified: trunk/test-applications/richfaces-docs/web/src/main/webapp/tree.xhtml
===================================================================
--- trunk/test-applications/richfaces-docs/web/src/main/webapp/tree.xhtml 2009-03-27
14:24:40 UTC (rev 13258)
+++ trunk/test-applications/richfaces-docs/web/src/main/webapp/tree.xhtml 2009-03-27
14:25:01 UTC (rev 13259)
@@ -1,70 +1,76 @@
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:s="http://jboss.com/products/seam/taglib"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:rich="http://richfaces.org/rich"
- template="layout/template.xhtml">
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:rich="http://richfaces.org/rich"
template="layout/template.xhtml">
-<ui:define name="body">
+ <ui:define name="body">
+ <h:messages globalOnly="true" styleClass="message" />
+ <rich:panel>
+ <f:facet name="header">rich:tree</f:facet>
+ <p>rich:tree is built from a simple org.richfaces.model.TreeNode
+ model</p>
+ <h:form>
+ <rich:tree value="#{tree.stationNodes}" var="station">
+ <rich:treeNode>
+ <h:outputText value="#{station}" />
+ </rich:treeNode>
+ </rich:tree>
+ </h:form>
-
- <h:messages globalOnly="true" styleClass="message"/>
-
-
-
- <rich:panel>
- <f:facet name="header">rich:tree</f:facet>
-
- <p> rich:tree is built from a simple org.richfaces.model.TreeNode
model</p>
-
-
-<h:form>
-
-<rich:tree value="#{tree.stationNodes}" var="station">
-
- <rich:treeNode>
-
- <h:outputText value="#{station}" />
-
- </rich:treeNode>
-
-</rich:tree>
-
-
-
-</h:form>
-
-<p> A simple rich:tree from a local XML file </p>
-
-<h:form>
-<rich:tree id="treeXML" value="#{tree.data}"
var="vardata">
-
- <rich:treeNode>
-
- <h:outputText value="#{vardata.attributes['name']}" />
-
- <h:outputText value="#{vardata.attributes['date']}" />
-
- <h:outputText value="#{vardata.attributes['time']}" />
-
- <h:outputText value=" #{vardata.text}" />
-
- </rich:treeNode>
-
-</rich:tree>
-
-
-
-
-</h:form>
-
-
-
- </rich:panel>
-
-
-</ui:define>
+ <p>A simple rich:tree from a local XML file</p>
+ <h:form>
+ <rich:tree id="treeXML" value="#{tree.data}"
var="vardata">
+ <rich:treeNode>
+ <h:outputText value="#{vardata.attributes['name']}" />
+ <h:outputText value="#{vardata.attributes['date']}" />
+ <h:outputText value="#{vardata.attributes['time']}" />
+ <h:outputText value=" #{vardata.text}" />
+ </rich:treeNode>
+
+ </rich:tree>
+ </h:form>
+
+ <br></br>
+ <h2>Case 3. Tree built with treeNodesAdaptors</h2>
+ <p>Using the <rich:treeNodesAdaptor> means that the typical tree
hierarchy should be built directly in the component tree.<br></br>
+ </p>
+ <h:form>
+ <rich:tree id="adaptor_based" >
+ <rich:treeNodesAdaptor id="adaptor"
+ nodes="#{shelf.albSet}"
+ var="album">
+ <rich:treeNode>
+ <h:outputText value="#{album}" />
+ </rich:treeNode>
+
+ <rich:treeNodesAdaptor id="adaptor2"
+ nodes="#{shelf.imgSet}"
+ var="image">
+ <rich:treeNode>
+ <h:outputText value="#{image}" />
+ </rich:treeNode>
+ </rich:treeNodesAdaptor>
+ </rich:treeNodesAdaptor>
+ </rich:tree>
+ </h:form>
+
+ <br></br>
+ <h2>Case 4. Tree built from XML (simple example)</h2>
+ <p>The <code>org.richfaces.model.TreeNode</code> interface, which is
used in following case, accepts data worked with
<code>org.richfaces.component.xml.XmlTreeDataBuilder</code> class and renders
it as tree nodes.</p>
+ <h:form>
+ <rich:tree id="tree"
+ value="#{hujations.data}"
+ var="vardata" >
+ <rich:treeNode>
+ <h:outputText value="#{vardata.text}" />
+ </rich:treeNode>
+ </rich:tree>
+ </h:form>
+
+ </rich:panel>
+ </ui:define>
</ui:composition>