2 Replies Latest reply on Sep 9, 2009 6:33 PM by tw

    rich:tree client side selection handling

    tw

      I need to handle tree selection change on the client. The onselected method allows me to call a JS function, but it does not provide any context (tree, selected node).

      onselected=populateScrollableTableFromCachedData()

      How do I access the client side tree / selected node object? I need to know what node was selected.

      Also, if I want to use a4j:support to handle selection (because oncomplete is broken), how do I propagate the selected node.


      Thanks!

        • 1. Re: rich:tree client side selection handling
          ilya_shaikovsky

          check drag and drop sample in tree page at richfaces-demo. Selection handled there well via ajax.

          No , we have no API to handle this on the client.

          • 2. Re: rich:tree client side selection handling
            tw

            Just in case someone else is looking to handle selection client-side, I was able to extract the selected node info like this:


            function processSelection (tree) {
            var str = tree.input.value;
            var treeTextNode = document.getElementById(str + ":text").childNodes[0];
            // label is treeTextNode.nodeValue
            }



            <rich:tree
            ...
            onselected="processSelection(this)"