cancel
Showing results for 
Search instead for 
Did you mean: 

List No Data

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

sreehari_vpillai
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

sreehari_vpillai
Active Contributor
0 Kudos

Bart,

  • Clear the browser cache and try once again, if still not working, check the below as well
  • Try OData model instead of JSON model and try.
  • Cross check if the entity set is having attributes Name and ID.
  • Clear the browser cache and check.
  • Check the error in google chrome debug consol
  • Try the below as well

Sree

Former Member
0 Kudos

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

Answers (0)