Primefaces : The commandLink, commandButton, nothing was invoking my actions or my actionListeners in the backend. It happens only when I call inside of the my tree or treeTable . How resolve this ?

It’s easy ! You need set true the attribute expand of the yours nodes and parents. Example :

public TreeNode makeTree()
      
      MyObject myFatherObject = new MyObject();
      // The first Node in the tree 
      TreeNode root = new DefaultTreeNode(myFatherObject, null);
      TreeNode nodeRoot = new DefaultTreeNode(myFatherObject, root);
      TreeNode node = new DefaultTreeNode(holding, nodeRoot);
      node.setParent(nodeRoot);

      node.setExpanded(true);
      node.getParent().setExpanded(true);
 
      // The node sun of the above  
      MyObject mySunObject = new MyObject();
      TreeNode sunNode = new DefaultTreeNode(
                                      "objectType", 
                                       mySunObject , 
                                       node);
      
      sunNode.setExpanded(true);
      sunNode.setParent(nodePrincipal);
      sunNode.getParent().setExpanded(true);

      return root;

}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s