on 2020 Feb 28 12:21 PM
Hi all!
I try to reproduce sample from sapui5 smarttable: there are metadata.xml, Products.json. But ODataModel is not filled with data.
Main.view.xml
<Page title="{i18n>title}">
<content>
<smt:SmartTable
entitySet="Products"
tableType="AnalyticalTable"
useVariantManagement="false"
useTablePersonalisation="true"
header="Products"
showRowCount="true"
enableAutoBinding="true" />
Main.controller.js
onInit: function () {
var oViewModel;
oViewModel = new JSONModel();
oViewModel.loadData("localService/Products.json", false);
this.getView().setModel(oViewModel, "appView");
this.getOwnerComponent().getModel("nwind").metadataLoaded();
}
What can be wrong in this code?
Thank you
Hello,
To use a smarttable you need an OData model and not a JSON model (it is possible but much more complex).
To do the demo project, if you have not a ODATA service available in you backend system then you need to simulate it thanks to a mockserver. Please refere to the documentation to know how to use mock data server in UI5.
Kund regards,
Joseph
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Denis Kitrish,
As you are using Smart Table, which will only works with OData. If you do not have OData Service, then you can test with Mockserver.
As you are trying with JSON Model, So you are not getting results.
If you want to know more, please refer this link for reference.
https://answers.sap.com/questions/90310/application-with-smarttable-and-jsonmodel-binding.html
Thanks and regards,
Chaitali Pandya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
57 | |
10 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.