Quantcast
Channel: SCN: Message List - SAP Manufacturing Integration and Intelligence (SAP MII)
Viewing all articles
Browse latest Browse all 4841

Re: Initialize ODataModel using IlluminatorOData service possible?

$
0
0

I will actually respond to this question, with a working snippet, of how I managed to make it run:

var oDataURL = "http://fitl01v060.eu.fit:51000/XMII/IlluminatorOData?QueryTemplate=path/to/my/MDOQuery";

var oModel = new sap.ui.model.odata.ODataModel(oDataURL, true);

 

This seems to correctly initialize the model, but tbh, I don't see any differences between this and the first version.

Now, in case other would have to do something similar, I allready binded this model to a table. The table holds the 15 rows, and when scrolled-down, the rest of the rows are fetched from the service:

 

 

var oTable2 = new sap.ui.table.Table({

  visibleRowCount: 15,

  threshold: 16,

}); 

 

var oMeta = oModel.getServiceMetadata();

var oControl;

        

for ( var i = 0; i < oMeta.dataServices.schema[0].entityType[2].property.length; i++) {

var property = oMeta.dataServices.schema[0].entityType[2].property[i];

    oControl = new sap.ui.commons.TextField().bindProperty("value",property.name);

    oTable2.addColumn(new sap.ui.table.Column({label:new sap.ui.commons.Label({text: property.name}), template: oControl}));

}

oTable2.setModel(oModel);

oTable2.bindRows("/Rowset(QueryTemplate='path/to/my/MDOQuery',RowsetId=1)/Row");


Viewing all articles
Browse latest Browse all 4841

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>