Skip to Content
2

How to get selected item binding context and model data

Jul 25, 2017 at 10:31 PM

124

avatar image
Former Member

For list item "select" event, to get current selected item record from binding context I used:

<code>evt.getSource().getSelectedItem().getBindingContext("yourModelName").getObject();

Is this the best way to get selected item model?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Srikanth KV Jul 26, 2017 at 02:23 AM
2

Event 'Select' is deprecated, instead use 'selectionChange' event. Use the below code for eventhandler

var oSelectedItem = oEvent.getParameter("listItem"); //Selected item...works only for single selection. 
                                                     // For multiple selections use "listItems" which returns array of
                                                     //   selected items
oSelectedItem.getBindingContext("yourModelName").getObject();
Share
10 |10000 characters needed characters left characters exceeded