Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

Re: Boolean type column in oData services with HANADB

$
0
0

It looks to me that the "formatter"-approach is limited to non-two-way-binding models, i.e. there is no way to translate back from input to model value. At least there is this comment visible in the UI5 debug source:

 

PropertyBinding.prototype.setExternalValue = function(oValue) {

  // formatter doesn't support two way binding

 

What you do instead (at least sometimes, not with 0/1 integer columns), is to make use of sap.ui.model.type.String when binding properties, e.g.


oCheckBox.bindProperty("checked", {path: "/some_path", type: BoolString, mode: sap.ui.model.BindingMode.TwoWay});


where you have declared   

 

var BoolString = new sap.ui.model.type.String();

 

Doing this, you leverage the automatic conversion that UI5 offers into boolean values:

 

boolean: "true" or "X" are interpreted as true, false, and " " as false  (from the documentation).

 

 

Regards,

Andreas

 

Message was edited by: Andreas Cardeneo after I found out about sap.ui.model.types.


Viewing all articles
Browse latest Browse all 9165

Trending Articles



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