I have enableSmartXMLParsing(true) set in my tree.
I need to focus/open the preselected item when user clicks on my form input (that displays tree)
I am passing the preselected items id as part of the XMLString returned from the servlet as userdata of one ID.
if I see
tree.selectItem(“551”) pass the id directly it works
but I need to retrieve 551 from another node (nodeid “1” always") userdata and open. I am not able to do that. I am doing shown below
tree.loadXML(“/mgmt-mbean-allowed-values?mbeanName=”+mbean+“&attributeName=”+param+“&default=”+value+“&operation=false”);
tree.selectItem(“1”);
var id = tree.getUserData(“1”, “preselectedId”);
alert("the preselect id is "+id);
tree.selectItem(id); //tree.selectItem(“551”);-----------> this works. I am trying to retrieve this from nodeid “1” userdata…
function doAfterLoading(){
tree.selectItem(“1”);
var id = tree.getUserData(“1”, “preselectedId”);
alert("the preselect id is "+id);
tree.selectItem(id);
}