on 04-02-2014 5:11 PM
In my view.js, I have my list defined:
var oList = new sap.m.List({
growing: true,
growingThreshold: 10
});
Looking for a simple example of getting the selected value from the list. Can anyone provide code snippet or idea on how to accomplish this? Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please use the below code to get the selected item from list
var oList = this.byId("productsList"),
oBinding = oList.getBinding("items");
var items = oList.getSelectedItems();
for (var i = 0; i < items.length; i++) {
var item = items[i];
var context = item.getBindingContext();
var obj = context.getProperty(null, context);
alert(obj.Name);
}
Thanks & Regards,
Hemachandran.R
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
var table = this.getView().byId("tableId");
var rowItems = table.getSelectedItems();
var asnnum = rowItems[0].mAggregations.cells[1].getProperty("text");
To achive the above please use selectionChange="your function name" property in your table and hadel the above inside your function
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you try with the command
var selItems = view.oList.getSelectedItems();
Regards,
Simmaco
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.