2 Replies Latest reply on Nov 18, 2007 3:00 PM by ykravchenko

    Selection in Tree

    ebariaux

      I have a rich:tree displaying some information on the left of the page and some detail about the selected item displayed on the right of the page.

      Using a nodeSelectListener binding, I store the row key of the selected object whenever an element is selected in the tree.

      I also have the possibility to add and delete elements in the tree.

      Let's say I have 3 elements in the tree, the last one is selected and I delete it, the tree still remembers that the 3rd element is selected (even if there is only 2 elements in the tree).
      So now if I had a new element, it becomes the 3rd one and is automatically selected.

      What I would prefer is that when I delete the 3rd element, the tree "looses" its selection, or that there is a method I can call from my backing bean to reset the selection on the tree.

      In fact, that last option would be useful in several cases.
      Is there a way to do that?


      Thanks,
      Eric