Page 1 of 1

Tree enhancement : deleting branch in the controller bean

Posted: 26 Mar 2010, 17:54
by jmcollin92
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.

Re: Tree enhancement : deleting branch in the controller bean

Posted: 30 Mar 2010, 16:09
by cagatay.civici
Sure, why not, we'll consider this thanks.

Re: Tree enhancement : deleting branch in the controller bean

Posted: 30 Mar 2010, 17:35
by Oleg
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? :-)

Re: Tree enhancement : deleting branch in the controller bean

Posted: 31 Mar 2010, 09:42
by Oleg
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.

Re: Tree enhancement : deleting branch in the controller bean

Posted: 31 Mar 2010, 17:20
by jmcollin92
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,