Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3022

Two-Way Binding with createEntry SAPUI5

$
0
0

I am trying to use Two-Way binding with a v2 OData model. In the route matched of the create view I have the following code.

 

this.getOwnerComponent().oWhenMetadataIsLoaded.then(function() {  var oEntry = oView.getModel().createEntry("/ContactCollection");  oView.setBindingContext(oEntry);
}.bind(this));  }.bind(this));

At runtime i call the screen and update a value in the create view that is "bound" to the model.

 

Then in my save function I have been executing the following line in the debugger.

 

this.getView().getBindingContext().getObject()

The output is a blank entity will all properties set to "undefined".

 

While searching I found this page

 

So i implemented line

 

oView.getModel().setDefaultBindingMode(sap.ui.model.BindingMode.TwoWay);

in the route matched function above with same results.

 

I have also tried using

 

oView.unbindElement();

from the discussion here

 

Any help would be appreciated.


Viewing all articles
Browse latest Browse all 3022

Trending Articles



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