dhtmlxTree editing nodes

I am trying to edit the name of a node on my dhtmlxTree. My problem is that I am unable to capture the new name that I enter.



How can I pass that name in the edit function? Is the name taken by the value parameter in onEdit( state, id, tree, value ) ? The value arguments is undefined when I pass it back to my java code.



does onEdit return the newly entered name? If so, should it called recursively in the edNodeFunction as in my code below?



Here’s my code:

-------------------------------------------

tree.attachEvent(“onEdit”, );



--------------------------------------





function edNodeFunction( nodeId ){    

     document.forms[0].action="/classToUpdateDBAction.do?step=funcWithSql&Id="+id+"&value="+onEdit();

     document.forms[0].submit();

}         



----------------------------------------------------------------------



Thanks.

In common case, if you know node ID then you can get it value as
    tree.getItemText(id)

In case of onEdit event you can get value as
    tree.attachEvent(“onEdit”,function(stage,id,that,value){
       if (stage == 2) {
          alert("new value = "+value)
       }
       return true;
    })