on 08-01-2014 10:16 AM
Hello Experts,
I'm trying to fill in my list with data from the gateway service:
var oListStandard1 = new sap.m.List({
inset : false
});
var oItemTemplate1 = new sap.m.StandardListItem({
type : sap.m.ListType.Navigation,
title : "{Name}",
description : "{ID}",
});
var oModel = new sap.ui.model.json.JSONModel(
"http://ws8flex71.sap.flexso.com:8000/sap/opu/odata/sap/YXM_GWS_BART_SRV/mat_group?$format=json");
oListStandard1.setModel(oModel);
oListStandard1.bindAggregation("items", "/Name",
oItemTemplate1);
But when i run the app the list says 'No Data' ...
Kind Regards,
Bart
Bart,
Specify till the Service name alone in the service URl. Remove /mat_group?$format=json .
Make sure if http://ws8flex71.sap.flexso.com:8000/sap/opu/odata/sap/YXM_GWS_BART_SRV/Name
displays all the required data.
Sreehari
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I change the code:
var oListStandard1 = new sap.m.List({
inset : false
});
var oItemTemplate1 = new sap.m.StandardListItem({
type : sap.m.ListType.Navigation,
title : "{Name}",
description : "{ID}",
});
var oModel = new sap.ui.model.json.JSONModel(
"http://ws8flex71.sap.flexso.com:8000/sap/opu/odata/sap/YXM_GWS_BART_SRV");
oListStandard1.setModel(oModel);
oListStandard1.bindAggregation("items", "/mat_group",
oItemTemplate1);
Normally http://ws8flex71.sap.flexso.com:8000/sap/opu/odata/sap/YXM_GWS_BART_SRV/mat_group
displays all the data.
Not http://ws8flex71.sap.flexso.com:8000/sap/opu/odata/sap/YXM_GWS_BART_SRV/Name
After this change the list is still empty 'No data'.
Regards,
Bart
Bart,
Sree
Thank you Sreehari,
It works now after i used OData model:
var sServiceUrl = "http://ws8flex71.sap.flexso.com:8000/sap/opu/odata/sap/YXM_GWS_BART_SRV";
var oModel = new sap.ui.model.odata.ODataModel(sServiceUrl, false,
"username", "password");
Instead of :
var oModel = new sap.ui.model.json.JSONModel(
"http://ws8flex71.sap.flexso.com:8000/sap/opu/odata/sap/YXM_GWS_BART_SRV");
Kind Regards
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
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.