cancel
Showing results for 
Search instead for 
Did you mean: 

How to read values of particular column after selecting a single row??

lalitha_p2
Explorer
0 Kudos

Hi All,

It's quite urgent ,plz help

I am using sap.ui.table and i am selecting one single row using singleselect mode,

My doubt is how to read the selected row data ?/

I have to pass one particular data from the selected row to next screen's odata which displays the detail respective to that row table...

Below is my code,

oTable = new sap.ui.table.Table({

  selectionBehavior: sap.ui.table.SelectionBehavior.RowSelector,

});

var oColumn = new sap.ui.table.Column({

  label: new sap.m.Label({text: "Hierarchy Level"}),

  template: new sap.ui.commons.TextView().bindProperty("text", "Level"),

  width: "200px",

  resizable:true

  });

  oTable.addColumn(oColumn);

  var welem = new sap.ui.table.Column({

  label: new sap.m.Label({text: "WBS Element"}),

  template: new sap.ui.commons.TextView().bindProperty("text", "WBSEleOP"),

  width: "200px",

  resizable:true

  });

  oTable.addColumn(welem);

  

  var des10 = new sap.ui.table.Column({

  label: new sap.m.Label({text: "Description"}),

  template: new sap.ui.commons.TextView().bindProperty("text", "WBSEleOPDes"),

  width: "200px",

  resizable:true

  });

  oTable.addColumn(des10);

  

  

  

  

  oTable.bindRows("/results");

  

  oTable.setModel(oModel7);

  

  

  

  

  

  //var n = new sap.m.Button("n",{text:"Detail",press:oController.onItemPress});

  

  var n = new sap.m.Button({

     text: 'Detailed View',

     press: oController.onItemPress

    

  }) ; 

Accepted Solutions (1)

Accepted Solutions (1)

vijay_kumar49
Active Contributor
0 Kudos
lalitha_p2
Explorer
0 Kudos

Hi Vijay,

I m using sap.ui.table ,for that this coding doesnt work..

vijay_kumar49
Active Contributor
0 Kudos

Do you have any constrain to use sap.ui.table.Table in-steed of sap.m.Table

any way check the your button code. when you click on Press

read the data from the column using sap.m.Button as per given example

Answers (1)

Answers (1)

junwu
Active Contributor
0 Kudos

var currentRowContext = oEvent.getParameter("rowContext");

var model=******* //get reference to your model

var cellproperty=model.getProperty("attributewhichbindtocolumn",currentRowContext)