Skip to Content
0
Mar 04, 2019 at 02:26 PM

SAP UI5: How to use ObjectNumber? Especially the "number" property in it.

2818 Views

<ObjectNumber
  number="{
    path: 'Price',
    formatter: '.formatter.numberUnit'
  }"
  unit="{CurrencyCode}"/

Hi experts,

In Demo Kit, the "number" property of "ObjectNumber" is just a String, but in most code, they use an Object with "path", "formatter", sometimes they use "parts" to specify an array of parts, such as below.

<ObjectNumber
   class="sapUiSmallMarginBottom"
   binding="{/ProductCollection/2}"
   number="{
      parts:[{path:'Price'},{path:'CurrencyCode'}],
      type: 'sap.ui.model.type.Currency',
      formatOptions: {showMeasure: false}
   }"
   unit="{CurrencyCode}"
   state="Warning" />

What is the "path", "formatter", "parts", "type", formatOptions" that used to build a "number"? Is this a general JavaScript Object builder or some features in UI5?

Thank you!