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.

TreeTable: Filter CustomTreeNodes

See original GitHub issue

Description Type of TreeNodes will be lost after filtering TreeTable. The problem is probably caused by

TreeTableRenderer.createNewNode(TreeNode node, TreeNode parent);

This method will always return DefaultTreeNode or CheckboxTreeNode, even if the Type of parameter node is CustomTreeNode. Because this method is called due filtering (TreeTableRenderer.filter(…)), the type of all nodes will be lost.

Environment:

  • PF Version: 8.0
  • JSF: Mojarra 2.3.9

Expected behavior createNewNode should return a node with the same type as node in parameter, so that nodes in TreeTable are the same type after filtering as before.

CustomTreeNode node = new CustomTreeNode(...);
TreeNode newNode = createNewNode(node, null) ;
if(newNode instanceof CustomTreeNode){
   //correct
}else{
   //incorrect
}

Possible solutions

  • handle filtering without creating new nodes
  • copy node via reflection

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
tandraschkocommented, Dec 8, 2020

Yeah, but thats the current impl. A improvement for the future would be to add a “filtered” flag to the TreeNode and not render again based on this decision.

1reaction
tandraschkocommented, Dec 8, 2020

I see. Please test again - you need to set cloneOnFilter=true now

Read more comments on GitHub >

github_iconTop Results From Across the Web

TreeTable Filter - PrimeNG - PrimeFaces
TreeTable Filter. Filtering is enabled by defining a filter template per column to populate the filters property of the TreTable.
Read more >
Filtering for Tree · Issue #1683 · primefaces/primeng - GitHub
The filter could work with the label of the Tree Nodes. In a project I'm using checkable tree nodes and sometimes it gets...
Read more >
JavaScript Custom Filters in TreeTable - Webix
Get custom filters in TreeTable сoding samples. Download TreeTable JavaScript example for free.
Read more >
Angular PrimeNG TreeTable Filtering - GeeksforGeeks
Angular PrimeNG TreeTable Filtering enables Filter options in the TreeTable component. So using filtering options, we can easily search and ...
Read more >
Angular - How to implement TreeView Table with filter
I want to build treeview table with sorting using PrimeNG and Angular 6. TreeTable is there in PirmeNG but i want ...
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