cancel
Showing results for 
Search instead for 
Did you mean: 

Adding type information in XML views

UweFetzer_se38
Active Contributor
0 Kudos
1,193

With JS views it is possible to add type information to a field, for example:


oControl = new sap.ui.commons.TextField({

     value: {

          path:"/company/revenue",

          type: new sap.ui.model.type.Float({

               minFractionDigits: 2,

               maxFractionDigits: 2

          })

     }

})

See https://sapui5.netweaver.ondemand.com/sdk/#docs/guide/BindingProperties.html

I've tried the same with XML views (according to https://sapui5.hana.ondemand.com/sdk/test-resources/sap/m/demokit/explored/index.html#/code/inputChe... ) without success


Please check my gist example: Binding problems with UI5 and XML views


Am I doing something wrong?

View Entire Topic
Former Member
0 Kudos

Hi,

No, you are doing fine!

The thing that is missing is what the documentation forgets to say.

<script src="resources_path/sap-ui-core.js" id="sap-ui-bootstrap"

  data-sap-ui-libs="sap.m"

  data-sap-ui-theme="sap_bluecrystal"

  data-sap-ui-xx-bindingSyntax="complex">

</script>

There is needed to tell the core that you are using a complex binding syntax. I don't know why that is not a default option, but that is the way it is.

Regards,

Luis Alberto