Quantcast
Viewing all articles
Browse latest Browse all 2806

How to get selected tree node path?

Dear Friends,

 

I am calling a MDO Select query in the webpage to generate a tree structure.

Earlier while running this page in SAP MII 15.0, I used oTree.oSelectedContext function to get the path of tree node as /Rowset/Row/0(NodeID).

But when I am running the same page in SAP MII 15.1 , it is saying that the function is undefined.

Can anyone help me on this?

 

 

My Code:

 

 

var oTree = new sap.ui.commons.Tree("oTree",{

width:"100%",

height:"100%",

showHeader: true,

showHeaderIcons: true,

select:function(){

  if(oTree.oSelectedNode==""){

  oButtonAddKPIAuto.setEnabled(false);

  oButtonAddKPIManual.setEnabled(false);

  }

  else{

         oButtonAddKPIAuto.setEnabled(true);

  oButtonAddKPIManual.setEnabled(true);

                oField1.setValue(oModelTreeKPI.getProperty(oTree.oSelectedContext+"/@NDE"));                     }

        }

});

var oTreeNodeTemplate = new sap.ui.commons.TreeNode("oTreeNode");

  oTreeNodeTemplate.bindProperty("text", "@NDE");

  oTreeNodeTemplate.setExpanded(true);

  oTree.bindAggregation("nodes", "/Rowset", oTreeNodeTemplate);

  oTree.setTitle("KPI Heirarchy");

 

I have defined oModelTreeKPI globally.

I am using oModelTreeKPI.getProperty(oTree.oSelectedContext+"/@NDE") function to populate the selected tree node value in the text field (oField1) which also I have defined globally. This function will give the value only when oTree.oSelectedContext function will give the path of the selected tree node.

 

 

Regards,

Shitikantha Nanda


Viewing all articles
Browse latest Browse all 2806

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>