12-17-2016 2:24 AM - edited 01-21-2024 9:43 PM
Hi all,
I am using SAP Web IDE and I have two json files and configured them in app descriptor as show below.
I want to get the model from app descriptor and iterate through JSON model and display data in a table from second.json file where Category1 is not equal to “0000” and category2 and category3 is equal to “0000” using first.json.
For the json two files “Type” property is common.
Please suggest me the idea and any help will be appreciated.
Manifest.json
...
"sap.ui5": {
"_version": "1.1.0",
"rootView": {
"viewName": "com.test.ui5.view.Products",
"type": "XML"
},
"dependencies": {
"minUI5Version": "1.30.0",
"libs": {
"sap.ui.core": {},
"sap.m": {},
"sap.ui.layout": {}
}
},
"contentDensities": {
"compact": true,
"cozy": true
},
"models": {
"i18n": {
"type": "sap.ui.model.resource.ResourceModel",
"settings": {
"bundleName": "com.test.ui5.i18n.i18n"
}
},
"first": {
"type": "sap.ui.model.json.JSONModel",
"uri": "model/first.json"
},
"second": {
"type": "sap.ui.model.json.JSONModel",
"uri": "model/second.json"
}
},
"resources": {
"css": [{
"uri": "css/style.css"
}]
}
}
First.json
{
"Type":"A",
"Category1":"0001",
" Category 2":"0000",
" Category 3":"0000",
},
{
"Type":"B",
"Category1": "0002",
" Category 2":"0000",
" Category 3":"0000",
}
... and so on..
Second.json:
{
"Type":"A",
"itemno": "2010",
" itemname":"Sugar",
},
{
"Type":"B",
"itemno": "2010",
" itemname":"Sugar",
} … and so on
in your controller, this.getOwnerComponent().getModel("first")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.