O'Reilly logo

PrimeFaces Beginner's Guide by K. Siva Prasad Reddy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – displaying posts using the TreeTable component

Let us see how we can display posts using the TreeTable component in the Year/Month/Posts hierarchy.

  1. Create a root TreeNode and add Year, Month, and Posts child nodes:
    public class TreeTableController { private TreeNode root; public TreeTableController() { root = new DefaultTreeNode("Root", null); TreeNode node2013 = new DefaultTreeNode(new PostNode("2013",""), root); TreeNode node2012 = new DefaultTreeNode(new PostNode("2012",""), root); TreeNode node2011 = new DefaultTreeNode(new PostNode("2011",""), root); TreeNode jan2013 = new DefaultTreeNode(new PostNode("Jan",""), node2013); TreeNode feb2013 = new DefaultTreeNode(new PostNode("Feb",""), node2013); TreeNode aug2012 = new DefaultTreeNode(new ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required