on 04-02-2014 9:18 PM
Trying to load my List with OData from a remote URL in JSON format.
Here's what I have in the controller.js onInit method:
//I do have to login to the SAP backend so not sure if this method signature even works. No exception is being thrown
var oModel = new sap.ui.model.json.JSONModel("url&$format=json", true, "username", "password");
sap.ui.getCore().setModel(oModel);
In my view.js:
var listtemplate = new sap.mObjectListItem({
title: "{matnum}",
intro: "{desc}"
});
var list = new sap.m.List("matlist", {
mode: ....singleselectmaster,
includeItemInSelection: true,
........
});
list.bindAgrregation("Inventory", "results", listtemplte);
JSON data format being returned is:
{
"d" : {
"results" : [
{ matnum: "data", desc: "data"},
{ matnum: "data", desc: "data"},
{ matnum: "data", desc: "data"},.............
............................
]
}
}
I'm not getting any exception thrown but my list is coming up empty. What I need is to grab the values of "matnum" on the list. Any help is greatly appreciated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.