Skip to Content
0
May 16, 2018 at 04:01 PM

MultiSelect Table - how to know which was the current item clicked/selected

124 Views

Hi,

I have a MultiSelect table.

<Table id="idProductsTable" inset="false" mode="MultiSelect" selectionChange="onInvoiceSelectionChange" items="{ path: '/value', sorter: { path: 'DocNum' } }">

When an item is selected (or un-selected) the event triggers a function:

onInvoiceSelectionChange : function(oEvent) {...

I need to know which item was selected so I coded this.

var oCtx = oEvent.getSource().getSelectedItem().getBindingContext();
var path = oCtx.getPath();

This always returns the first (lowest) selected item in the list - not the current one: E.g. if paths are:

/value/0

/value/1

/value/2

If I select/click the first item and then the second item the path = "/value/0" BOTH TIMES!

I need to determine "/value/1" was the selection the second time.

There does not seem to be any property "current item clicked" in the oEvent or its child objects. Just the list of selected items with the "lowest" always returned as the path.

Thanks for any help.

Regards,

Mel