Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

problem using two way binding of json model..

$
0
0

Hey,

I am trying to bind sapui5 controls to a json model using bind value & bind property as shown

 

miApprovalDatePicker.bindValue("UIModel>/issueDate");
miApprovalDatePicker.bindProperty("value","UIModel>/approvalDate");

UIModel is the json Model which i have declared in my onit: of controller as shown

var UIModelCore = new woodsoftui5.model.MaterialIssueOrder();        var UIModelJson = new sap.ui.model.json.JSONModel();        UIModelJson.setData(UIModelCore);        sap.ui.getCore().setModel(UIModelJson,"UIModel");

but i have a similar model which i use it to save data when i search using Ajax service where i am setting data to both UIModel &  miModeljson

 

I am comparing if there is any change in UIModel &  miModeljson in my save function as shown

 miSave: function (showPrintOrder) {        var UIModel = sap.ui.getCore().getModel("UIModel");                   /****Checking if there is any change in values in ui and values obtained from data base*******************/        if (!(_.isEqual(miModelJson.oData, UIModel.oData))) {.....Ajax call for save...}

the problem is that the values of the controls are also binding to miModelJson which i think a problem with twoWay binding which is new to me!!!!

The whole thing i am doing is to eliminate Ajax for Save,

 

please help...............

 

regards,

Raghu

thelJson


Viewing all articles
Browse latest Browse all 6178

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>