on 03-06-2017 3:45 PM
Hi Experts,
I am using the sap.m.List in my code, able to display list of items.
upon pressing the list item I need to capture the item that is pressed using press event listener.
Please help me in getting the list item pressed.
View Code:
---------------
<Listid="listId"
items="{/}"
itemPress="listItemPress">
<items>
<StandardListItem title="{dtext}"
type="Active"/>
</items>
</List>
Controller Code:
----------------------
listItemPress: function(oEvent) {
var oContext = oEvent.getSource().getBindingContext();
var selectedIndex = oContext.sPath.split("/")[2];
console.log(oContext);
}
oEvent.getParameters().listItem
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Jun it worked.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.