3 Replies Latest reply on Aug 7, 2009 3:57 PM by margotmedia

    rich:tree and nodeSelectListener

    margotmedia

      Hi!

      I am using rich:tree in my application and it works fine except the nodeSelectListener (even it should be the expected behaviour).

      When a node is selected, my selectListener is called correctly. Now a user can click an a4j:commandButton in my application. This command button executes some update action on the form. Now I want, that the selected node can be selected a second time. But, when the user clicks the selected node, the selectListener isn't called.

      May be it is the expected behaviour, but i need this feature like I explained above. It's very important for the application.

      Does anybody know a workaround for this scenario?

      Thank you very much!

      regards,
      margotmedia.

        • 1. Re: rich:tree and nodeSelectListener
          margotmedia

          fyi: I tried also rerendering the tree component, but despite the rerendering the node is still selected and when clicking on the node the selectListener isn't called.

          I looked in the javadoc, but couldn't find a method for setting or getting the selected node. Did I miss anything?

          Thanks!

          regards,
          margotmedia.

          • 2. Re: rich:tree and nodeSelectListener
            ilya_shaikovsky

            use tree state advisors in order to select/deselect/expand/collapse nodes between requests.

            • 3. Re: rich:tree and nodeSelectListener
              margotmedia

              Thank you for your reply! These methods are for sure very useful. But I didn't find good documentations or examples, so I wan't able to use them.

              However I found out how to solve my problem. Now I using the componentState attribute of the tree. With the componentState in the backing bean, I can easily change the state at any time I want and then reRender the tree.

              regards,
              margotmedia.