cancel
Showing results for 
Search instead for 
Did you mean: 

Extracting selected rows data from sap.m.Table in MultiSelect mode

Former Member
0 Kudos

Hello colleagues,

I have a table in MultiSelect mode as follows:

I need to extract the data (the text field value and the text of the selected items from the MultiCombo) for each selected row.

Regards,

Ivan

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi Ivan,

Retrieve the table by using the id mentioned in the view.

If you are using json model and setting it to the table, then you can extract the data entered in the table by using "getModel().oData" as json model is two-way binding by default.

To do the same use "selectedKeys" property in the "MultiComboBox".

<MultiComboBox selectedKeys="{selItems}" >

Now while retrieving use the code : in record i'm storing one item,

var selContexts = oTable.getSelectedContexts();
var id="", selItems = [], record = {}; 
for(var i=0;i<selContexts.length;i++)
{
   record = oTable.getModel().getProperty(selContexts[i].sPath);// one item
   id = record.id;
   selItems = record.selItems; // it is array of strings
}