Dears,
I've created JSON model in my webIDE project. and I've used only two of its attributes in my the view. But when I try to call JSON file data in the controller the consol.log shows only the two used items and ignores the rest.
JSON file:
{
"DocNum": "111",
"FormNo": "10",
"EmpNum": "00020000",
"Amount": "1000.00",
"Currency": "USD",
"Beneficiary": "0020000050",
"ReqFor": "D"
}
Component.js file
var oModel = new JSONModel("./model/CreateData.json");
oModel.setDefaultBindingMode("OneWay");
this.setModel(oModel, "CreateData");
Controller.js file
PostData: function(oEvent){
var oModel = this.getOwnerComponent().getModel("CreateData");
console.log(oModel);
}
View.xml file
<mvc:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" xmlns:html="http://www.w3.org/1999/xhtml" controllerName="PayTest.controller.CreateView">
<App>
<pages>
<Page title="{CreateData>/Beneficiary}" showNavButton="true" navButtonPress="onNavBack">
<content>
<Button text="{CreateData>/EmpNum}" width="100px" id="__button0" press="PostData"/>
</content>
</Page>
</pages>
</App>
</mvc:View>
Is there is any explanation for that?
Note: same behaviour when loading it in the manifest.json file