I decided to write some code to test this issue easily and found that the issue 
pops up with surprisingly little data.  My test code follows...  Please note 
that I haven't made sure I have the latest version yet....  I will do that soon.

------------------------testTreeTable.jsp-----------------------------
<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f" %>
<%@ taglib uri="http://myfaces.apache.org/trinidad"; prefix="tr"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<body>
 <f:view>
  <h:form>
   <h:outputText value="Test TreeTable with " />
   <h:inputText value="#{TEST.numberOfBranches}" />
   <h:outputText value=" branches.  " />
   <h:commandLink value="Go" action="#{TEST.runTest}" />
  
   <tr:treeTable value="#{TEST.model}" var="model" width="100%" 
rowBandingInterval="1" >
    <f:facet name="nodeStamp">
     <tr:column>
      <tr:outputText value="#{model.thingName}" />
     </tr:column>    
    </f:facet>
   </tr:treeTable>
  </h:form>
 </f:view>
</body>
</html>
----------------------------------------------------------------------------------

---------------------------TestTreeTable.java-----------------------------
package test;
import java.util.ArrayList;
import java.util.List;
import org.apache.myfaces.trinidad.model.ChildPropertyTreeModel;
import org.apache.myfaces.trinidad.model.TreeModel;
public class TestTreeTable {
 
 private TreeModel model;
 private ArrayList<TreeThing> modelList;
 
 private String numberOfBranches;
 
 public TestTreeTable() {
  numberOfBranches = "5";
  modelList = new ArrayList<TreeThing>();
 }
 
 public String runTest() {
  initializeTest(Integer.parseInt(numberOfBranches));
  
  return "";
 }
  
 private void initializeTest(int n) {
  TreeThing rootNode = new TreeThing("Scientific classification");
  
  for(int i = 1; i <= n; i++) {
   TreeThing kingdom = new TreeThing("Kingdom " + i);
   TreeThing phylum = new TreeThing("Phylum " + i);
   TreeThing classTreeThing = new TreeThing("Class " + i);
   TreeThing order = new TreeThing("Order " + i);
   TreeThing family = new TreeThing("Family " + i);
   TreeThing genus = new TreeThing("Genus " + i);
   TreeThing species = new TreeThing("Species " + i);
   
   genus.getChildren().add(species);
   family.getChildren().add(genus);
   order.getChildren().add(family);
   classTreeThing.getChildren().add(order);
   phylum.getChildren().add(classTreeThing);
   kingdom.getChildren().add(phylum);
   
   rootNode.getChildren().add(kingdom);
  }
  modelList = new ArrayList<TreeThing>();
  modelList.add(rootNode);
  model = new ChildPropertyTreeModel(modelList, "children");
 }
 
 public TreeModel getModel() {
  return model;
 }
 
 public void setModel(TreeModel model) {
  this.model = model;
 }
 
 public String getNumberOfBranches() {
  return numberOfBranches;
 }
 
 public void setNumberOfBranches(String numberOfBranches) {
  this.numberOfBranches = numberOfBranches;
 }
 
 public class TreeThing {
     public TreeThing(String name)
     {
       _name = name;
     }
     
     public String getThingName()
     {
       return _name;
     }
     
     public List<TreeThing> getChildren()
     {
       return _children;
     }
     
     private final String _name;
     private final List<TreeThing> _children = new ArrayList<TreeThing>();
 }
}
----------------------------------------------------------------------------------


      
____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

Reply via email to