2 Replies Latest reply on Mar 25, 2010 3:57 AM by draganc

    rich:tree processNodeSelection question

      Hello everyone,

       

      Scenario:

      1. I select tree node, processNodeSelection is triggered (OK)

      2. I select same tree node again, processNodeSelection is not triggered

       

      How can I make processNodeSelection to be triggered every time ?

       

      Problem explanation (real life):

      keywords.JPG

      I have rich:tree and context menu for CRUD operations on database. Problem is when delete node occurs, if I delete node named 'a' selection automatically transfers to node's brother named 'asdfasdf', so when I right click again on 'asdfasdf' to delete or rename him, processNodeSelection is not fired.

       

      <rich:tree ajaxSubmitSelection="true"
                  ajaxSingle="true" reRender="keywordAddEditDeleteForm" 
                  nodeSelectListener="#{keywordBean.processNodeSelection}"
                  rightClickSelection="true">

       

      Thank you for your answers. Dragan

        • 1. Re: rich:tree processNodeSelection question
          harut
          • 2. Re: rich:tree processNodeSelection question

            I tried using suggested solution: onlick + actionListener, but need help with implementation.

             

            <rich:tree id="keywordTree" ajaxSubmitSelection="true"
                        reRender="keywordAddEditDeleteForm" 
                        rightClickSelection="true">
                       <a4j:support event="onclick" actionListener="#{keywordBean.processNodeClick}" />
            
            
            public void processNodeClick(ActionEvent event){
                    HtmlTree tree = (HtmlTree)event.getComponent().getParent();
                    selectedNodeData = (Keyword)tree.getRowData();
            }
            

             

            Problem is that getRowData() always returns null. Do you have any suggestions how to solve this ?