Here i am using the table to display data from OData service. Rather displaying the data i could see blank but nothing, which means it says values are available. But it is not able to navigate to the path or display the values.
view.xml
<Table id="BoM" headerText="BOM Details" class="sapUiResponsiveMargin" width="auto"
items="{path : 'oModelBoM>/'
}">
<columns>
<Column>
<Label text="Material" />
</Column>
<Column>
<Label text="Component" />
</Column>
<Column>
<Label text="Brand" />
</Column>
</columns>
<items>
<ColumnListItem>
<cells>
<Text text="{oModelBoM>Material}" />
<Text text="{oModelBoM>Component}" />
<Text text="{oModelBoM>Brand}" />
</cells>
</ColumnListItem>
</items>
</Table>
odata.js
getProductBoM : function(iNumber){
var sNumber = iNumber.toString();
while (sNumber.length < 18) {
sNumber = "0" + sNumber
}
var vUriRead = "/ProductHeadSet('12345')/ProductHead2BOM/
var oResult;
this.initODataModel( );
this.oDataModel.read(vUriRead, null, null, false, function(oData, oResponse) {
oResult = oData;
}, function(oError) {
jQuery.sap.log.error("OData-Error in function getProductBoM (EntityProductHead2BOM)");
xyz_homepage.xyz_homepage.src.odata.displayRequestFailedMessage(oError);
});
return oResult;
}
controller.js
onInit : function() {
var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
oRouter.attachRouteMatched(this.handleRouteMatched, this);
this.oModelBoM = new sap.ui.model.json.JSONModel();
this.getView().setModel(this.oModelBoM, "oModelBoM");
},
handleRouteMatched : function(oEvent) {
if (oEvent.getParameter("name") === "ListDetailView") {
var iNumber = oEvent.getParameter("arguments").number;
//Call bom routine and set data
var oBoM = xyz_homepage.xyz_homepage.src.odata.getProductBoM(iNumber);
this.oModelBoM.setData(oBoM);
So the Uri tries to navigate to the path BOM but it is not happening, with the reference of the "12345" matching BOM should be displayed. Here i am using static reference as "12345", adding to same point could it be dynamic.
EDIT :
I get blank table but when i debug, the array is passing the value. Please find the screen shot below, but the values are not displaying on the table.
Thanks and Appreciated !!!