Skip to Content
author's profile photo
Former Member

WebDynpro Tree rendering in SP4

Hi,

I have a recursive tree which when loaded in the view, is displayed with the first level expanded by default. This never happened in SP2. How do I avoid this? I tried with all the attributes of the tree... nothing seems to be of any help.

Any ideas? Please let me know.

Thanks

Shakeel

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • author's profile photo
    Former Member
    Jun 22, 2004 at 12:35 PM

    Hi Shakeel,

    The tree UI Element initially expands all necessary nodes to make the selected element visible. If you do not want the first node to be expanded, simply call the method setTreeSelection(null) on the context node the tree dataSource is bound to with null as argument (e.g. in the doInit where you populate the tree context). This way nothing is selected and the first node won't be expanded.

    Another way to make sure that nothing is selected in the tree and thus no nodes are automatically expanded is to set the property 'initializeLeadSelection' of the context nodes the tree and its tree nodes are bound to false.

    Hope that helps!

    Karin

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thank you Karin! The second option works.

      Just one more ques: When a particular node is expanded, is it possible to collapse all other open nodes? ... Just to make sure that at a given point of time only one node is kept expanded. This avoids scrolling down in the IE window.

      -Shakeel