More explaination about TreeTable? - please read.

UI Components for JSF
Post Reply
samwun9988
Posts: 69
Joined: 22 Jan 2011, 11:04

04 Apr 2011, 14:53

Hello,

I found it hard to understand the showcase example for TreeTable.
Here I highlight it as follow:

Code: Select all

  TreeNode documents = new DefaultTreeNode(new Document("Documents", "-", "Folder"), root);
		TreeNode pictures = new DefaultTreeNode(new Document("Pictures", "-", "Folder"), root);
		TreeNode music = new DefaultTreeNode(new Document("Music", "-", "Folder"), root);
		
		TreeNode work = new DefaultTreeNode(new Document("Work", "-", "Folder"), documents);
		TreeNode primefaces = new DefaultTreeNode(new Document("PrimeFaces", "-", "Folder"), documents);
		
		//Documents
		TreeNode expenses = new DefaultTreeNode("document", new Document("Expenses.doc", "30 KB", "Word Document"), work);
		TreeNode resume = new DefaultTreeNode("document", new Document("Resume.doc", "10 KB", "Word Document"), work);
		TreeNode refdoc = new DefaultTreeNode("document", new Document("RefDoc.pages", "40 KB", "Pages Document"), primefaces);
		
		//Pictures
		TreeNode barca = new DefaultTreeNode("picture", new Document("barcelona.jpg", "30 KB", "JPEG Image"), pictures);
		TreeNode primelogo = new DefaultTreeNode("picture", new Document("logo.jpg", "45 KB", "JPEG Image"), pictures);
		TreeNode optimus = new DefaultTreeNode("picture", new Document("optimusprime.png", "96 KB", "PNG Image"), pictures);
The initial constructions of the Tree are undstandable until it gets to the //Documents and //Pictures.
What is "document" and "picture" in the constructors?

Why can't it be written as TreeNode expenses = new DefaultTreeNode(new Document("Expenses.doc", "30 KB", "word document"), work); ?

Very appreciate for any suggestion and further explaination.

Thanks
Sam
Primefaces 2.2.1, JBOSS 6.0.0.Final, JDK1.6

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 25 guests