question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tree: DeferredWidgets not rendered properly on Node other than root

See original GitHub issue

Describe the defect I am trying to create <p:tree> with <p:textEditor> inside each <p:treeNode>. The problem is that <p:textEditor> only renders correctly in the root of <p:treeView>. On the other hand, <p:inputText> renders correctly on every <p:treeNode>.

Reproducer primefaces-test.tar.gz

Environment:

  • PF Version: 8.0 and 7.0
  • JSF + Mojarra (2.2 and 2.3) and MyFaces (2.2 and 2.3)
  • Affected browsers: All

To Reproduce Steps to reproduce the behavior:

  1. run test app
  2. expand child element of a tree

Expected behavior Every tree node should render p:textEditor elements properly. p:textEditor renders only on the root.

Example XHTML <h:form> <p:tree value=“#{testView.root}” var=“node”> <p:treeNode> <p:textEditor value=“#{node}” /> </p:treeNode> </p:tree> </h:form>

Example Bean


@Named
@ViewScoped
public class TestView implements Serializable {

    TreeNode root;

    @PostConstruct  
    public void init() {
        root = new DefaultTreeNode("Root", null);
        TreeNode node0 = new DefaultTreeNode("Node 0", root);
        TreeNode node1 = new DefaultTreeNode("Node 1", root);

        TreeNode node00 = new DefaultTreeNode("Node 0.0", node0);
        TreeNode node01 = new DefaultTreeNode("Node 0.1", node0);

        TreeNode node10 = new DefaultTreeNode("Node 1.0", node1);

        node1.getChildren().add(new DefaultTreeNode("Node 1.1"));
        node00.getChildren().add(new DefaultTreeNode("Node 0.0.0"));
        node00.getChildren().add(new DefaultTreeNode("Node 0.0.1"));
        node01.getChildren().add(new DefaultTreeNode("Node 0.1.0"));
        node10.getChildren().add(new DefaultTreeNode("Node 1.0.0"));
        root.getChildren().add(new DefaultTreeNode("Node 2"));
    }

    public TreeNode getRoot() {
        return root;
    }

    public void setRoot(TreeNode root) {
        this.root = root;
    }
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
stolpcommented, Oct 29, 2020

In my application I have a tree which nodes are composed of several components (inputText, several commandButton). This is working fine. I also have TextEditors in TabViews in a dataTable. I also plan to have TextEditors in TreeTables.

So I think it is a valid assumption to expect to have them work in a TreeView as well.

1reaction
mellowarecommented, Oct 29, 2020

While this is definitely not working is this really a UI you are using with TextEditors in every Node of a treeview?

Read more comments on GitHub >

github_iconTop Results From Across the Web

jsTree not rendering list properly? - Stack Overflow
The list displays normally, just regular HTML, not as a tree like it should. There are no errors in the console. The jsTree...
Read more >
Check whether a binary tree is a full binary tree or not
If a binary tree node has left and right sub-trees, then it is a part of a full binary tree by definition. In...
Read more >
PeopleTools 8.52: PeopleSoft Tree Manager
The root node is always expanded. Expand All. Click to expand all of the nodes on the tree, so that the entire tree...
Read more >
Chapter 12 Trees
The ancestors/descendents of x other than x itself are its proper ancestors/descendents. If you pick some random node a in a tree T,...
Read more >
Everything you need to know about tree data structures
Trees are well-known as a non-linear data structure. ... If this root node is connected by another node , the root is then...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found