on ‎2016 Dec 23 6:38 AM
Hi All,
I'm trying to develop SAPUI5 application using smart table with the json model binding. While running the program I'm getting error I'm sharing that snapshot with you.I'm sharing my code, please suggest me to how to make this work.
And please say how to refer JSONModel data/entity set to the annotations.xml file
In view:
<smartTable:SmartTable
id="smartTable_ResponsiveTable"
smartFilterId="smartFilterBar"
tableType="ResponsiveTable"
editable="false"
entitySet="tableSet"
useVariantManagement="false"
useTablePersonalisation="false"
header="Products"
showRowCount="true"
useExportToExcel="false"
enableAutoBinding="true"
initiallyVisibleFields="name">
</smartTable:SmartTable>In Controller:
var array = [{
"name" : "Dinesh",
"id" : "123"
},
{
"name" : "Nikhil",
"id" : "456"
},{
"name" : "Pulkit",
"id" : "789"
}];
var model = new sap.ui.model.json.JSONModel();
model.setData({
tableSet: array
});
this.getView().byId("smartTable_ResponsiveTable").setModel(model);
});
I'm getting above error after running it. According to my knowledge smart table not able to get the data( that is entity set configuration issue). Please suggest me how to fix this and how to write annotations.xml file for JSONModel data
Regards,
Sai Ram Dinesh Pallapotu
Request clarification before answering.
Hi Sairam,
Kalyan is right. But let me add the information that the OData metamodel of SAP UI5 evaluates the app descriptor (manifest.json) in order to know where to find the annotations. THus, if you want to efine your columns et al. in a local annotation file, this annotation file must be registered correctly in the manifest.json.
Example:
"dataSources": {
"mainService": {
"uri": "/sap/opu/odata/sap/SEPMRA_PROD_MAN/",
"type": "OData",
"settings": {
"annotations": [
"localAnnotations"
],
"localUri": "localService/metadata.xml"
}
},
"localAnnotations": {
"uri": "annotations/annotations.xml",
"type": "ODataAnnotation",
"settings": {
"localUri": "annotations/annotations.xml"
}
}
},
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 13 | |
| 8 | |
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.