April 2004
Intermediate to advanced
606 pages
20h 4m
English
The com.mycompany.jsf.component.UITree class is
the implementation of the tree component.
It’s quite similar to the standard
UIData component. It uses a set of component
instances defined as facets to render all objects in the model. It
repeatedly calls the setNodeId() method as it
traverses the tree in all request processing lifecycle phases and
exposes the current node through a request scope variable, and then
asks the appropriate facet for the current node to process it. The
main difference is that the UITree component works
with a tree structure model, while UIData works
with a model of rows and columns.
The first part of the class should look familiar from the previous section:
package com.mycompany.jsf.component; import java.io.IOException; import java.io.Serializable; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import javax.faces.application.FacesMessage; import javax.faces.context.FacesContext; import javax.faces.component.EditableValueHolder; import javax.faces.component.NamingContainer; import javax.faces.component.UIComponent; import javax.faces.component.UIComponentBase; import javax.faces.el.ValueBinding; import javax.faces.event.AbortProcessingException; import javax.faces.event.FacesEvent; import javax.faces.event.FacesListener; import javax.faces.event.PhaseId; import com.mycompany.jsf.model.TreeNode; import com.mycompany.jsf.model.TreeModel; public class UITree extends UIComponentBase ...
Read now
Unlock full access