Let's follow up this discussion at the Neptune Community

(this forum will be kept in read-only mode)

Tables: Select Multiple Items

Hi there,


I have a table with the property of MultiSelect. I need to now get the values of all items selected. When using:


oTable.getSelectedItems( ) 


I can see it returns the selected items but no details. I need the data stored in the selected array objects.

 

Any advise?

1 Comment

Hi Shireen,


this Code should help:


var itemsSelected = yourTable.getSelectedItems();


for (i=0; i<itemsSelected.length; i++){

var item = itemsSelected[i];

var context = item.getBindingContext();

var value = context.getProperty("yourField");


// Do something

}


If you right-click in our JavaScript Editor, you will find this and other helpful code snippets. The above code can be found under SAPUI5 - List/Table Mobile - Get Multiselection.


Best regards

Christoph

Login or Signup to post a comment