Skip to Content
avatar image
Former Member

How to get selected item binding context and model data

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?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jul 26, 2017 at 02:23 AM

    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();
    Add comment
    10|10000 characters needed characters exceeded