Tree enhancement : deleting branch in the controller bean

UI Components for JSF
Post Reply
jmcollin92
Posts: 145
Joined: 05 Nov 2009, 22:32

26 Mar 2010, 17:54

Hello,

I would like to know if it is possible to add a deleteNode method in the TreeNode class in order to delete a child.
It should be something like this :

Code: Select all

TreeNode toRemove = xxx;
toRemove.getParent().getChildren().remove(toRemove);
with cleaning all the links between TreeNode.

It would be helpfull I think.
----
Primefaces 2.0.1-SNAPSHOT
JBoss 6.0.0-M2
Mojorra 2.0.2
---

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

30 Mar 2010, 16:09

Sure, why not, we'll consider this thanks.

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

30 Mar 2010, 17:35

cagatay.civici wrote:Sure, why not, we'll consider this thanks.
Super! I need this feature urgent too. Do you have already a timeline for this implementation? :-)
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

31 Mar 2010, 09:42

The other feature I didn't find is a possibility to set a TreeNode as disabled (not clickable). We can define nodeSelectListener and it's valid for all nodes. There isn't possiblity to make a text / label of some node(s) not clickable (= "readonly"). You maybe say - use onNodeSelect and returns false for such nodes. Well, but better would be to have a method setDisabled(boolean) in TreeNode.

Now to "type" attribute. I didn't find any restrictions in the documentation and suppose it's valid for all nodes. Right? There is an example with Document Tree where type is defined for leafs. But how does it work for non leaf nodes? Non leafs have two states - open and close. How can we define own images for close and open states? I couldn't do that with type attribute. Just with "crypto" CSS selectors?

Thanks for your explanation.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

jmcollin92
Posts: 145
Joined: 05 Nov 2009, 22:32

31 Mar 2010, 17:20

Hello Oleg,

Disabling a node is also an insteresting feature for me. Cagatay, do we have to open Jira issue to keep track of those enhancements ?

To change the icon of non leaf TreeNode, the documentation talks only about css descriptor :

Code: Select all

/* Folder Theme */
.ygtvtn { background: url(../../images/folders/tn.gif) 0 0 no-repeat; width:17px; height:22px; }
.ygtvtm { background: url(../../images/folders/tm.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer }
.ygtvtmh { background: url(../../images/folders/tmh.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer }
.ygtvtp { background: url(../../images/folders/tp.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer }
.ygtvtph { background: url(../../images/folders/tph.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer }
.ygtvln { background: url(../../images/folders/ln.gif) 0 0 no-repeat; width:17px; height:22px; }
.ygtvlm { background: url(../../images/folders/lm.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer }
.ygtvlmh { background: url(../../images/folders/lmh.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer }
.ygtvlp { background: url(../../images/folders/lp.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer }
.ygtvlph { background: url(../../images/folders/lph.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer }
.ygtvloading { background: url(../../images/folders/loading.gif) 0 0 no-repeat; width:16px; height:22px; }
.ygtvdepthcell { background: url(../../images/folders/vline.gif) 0 0 no-repeat; width:17px; height:22px; }
I'm not sure we need something else as non leaf are always the same type (ie : leaf's container). Not ?

Regards,
----
Primefaces 2.0.1-SNAPSHOT
JBoss 6.0.0-M2
Mojorra 2.0.2
---

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 31 guests