Skip to Content
-1
Nov 02, 2018 at 03:13 PM

JSON model loaded but no data

567 Views Last edit Nov 02, 2018 at 03:22 PM 3 rev

Hello together,

What I want to do is:

- load a model with some data from a local json file

In the WebIde the data will be loaded correctly but when I deploy the application to the backend I'm not able to read the propertys.

The SAPUI5 Versions are:

- WebIDE: 1.56.10

- Backend: 1.52.09 (Should be newest stable Version)

I have a Json File (model/AppData.json):

{ "AddData":{ 	<br>	"IdKunnr": "0000000035" }
}

manifest.json:

"models":{    <br>	"AppData": { 	<br>		"type": "sap.ui.model.json.JSONModel", 	"settings": {}, 	<br>		"uri": "model/AppData.json", "preload": true }

}

In a Controller I try to Access the data:

onAddItem: function (oEvent) {  

	var v1 = this.getView().getModel("AppData").getProperty("/AppData/IdKunnr");

...


v1 is undifined (when I test in backend - in SAP Web Ide all works fine).

When I debug the coding I can see the the model "AppData" exists but has no Content in the oData Variable.

Perhaps anybody can help me.

Best regards