4 Replies Latest reply on Feb 4, 2009 9:06 AM by timbooo

    tree manual selection from model

    timbooo

      hi there,

      isn't there an easy way to select a special node by the model?

      something like:

      currentNode.getChild(objId).select()


      i don't need to expand or collapse anything, i just want to select a node in an already expanded list of nodes.

      if that's not possible, what would be the easiest/best way to do this?

      any help will be appreciated.

      kind regards,
      tim.

        • 1. Re: tree manual selection from model
          ilya_shaikovsky

          check adviceNodeSelected attribute usage. adviceNodeOpened which has the same usage for collapse/expand - show at demo. So you could use first in the same way.

          • 2. Re: tree manual selection from model
            timbooo

             

            "ilya_shaikovsky" wrote:
            check adviceNodeSelected attribute usage. adviceNodeOpened which has the same usage for collapse/expand - show at demo. So you could use first in the same way.

            i don't get it. seems to me, i can just select the currentNode.
            but in my case, i remove a child from the tree and then want to select another node. or i'm adding a child, rerendering the tree and i want to select the new node then.


            kind regards,
            tim.

            • 3. Re: tree manual selection from model
              ilya_shaikovsky

              the advisor now is the only way to set the selected node. I think it will works for your case also. Just store the node you want to select after some actions and in adviceNodeSelected method check if this node is the node you stored - return true.

              • 4. Re: tree manual selection from model
                timbooo

                well ok, i've got it to select my new added node.
                but then the selectionListener from my tree won't get fired.
                is there a way to fix this?

                kind regards,
                tim.