TreeNode is abstract, cannot be instantiated...

UI Components for JSF
Post Reply
Jim Rocard
Posts: 5
Joined: 11 Aug 2011, 01:56

13 Aug 2011, 00:56

Hello, I am attempting to implement a basic treenode model and eventually would like to implement the tree table, however Netbeans throws an error "org.primefaces.model.TreeNode is abstract; cannot be instantiated" when the following code is called:

Code: Select all

public void setRootNode(){
        root = new DefaultTreeNode("root", null);
        TreeNode directoryNode;
        Directory d = new Directory();
        TreeNode documents = new DefaultTreeNode("documents", root);
        List<Directory> dirs = directCont.getItemsByOwner();
        Iterator it = dirs.iterator();
        while (it.hasNext()){
             d = (Directory)it.next();
             directoryNode = new TreeNode(d);          
        }
I feel like I'm doing something wrong, but I have been staring at it for a while and can't seem to figure out what it is.

Thanks in advance!!

Jim Rocard
Posts: 5
Joined: 11 Aug 2011, 01:56

13 Aug 2011, 01:06

"As for TreeNode, you need to use DefaultTreeNode class now."

Answered my own question. Thanks.

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

13 Aug 2011, 09:47

No need to stare... Just look at the labs examples...

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 51 guests