Skip to Content
0

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

Dec 19, 2016 at 03:36 PM

45

avatar image
Former Member

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

asd.jpg (32.3 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member Dec 22, 2016 at 06:26 PM
0

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
}

Share
10 |10000 characters needed characters left characters exceeded