I have a list of elements (OData set) and use a binding to show this list. One field is for a quantity value and this value could sometimes need some decimal places.
The requirement is: only show that amount of decimal numbers that is also available in the OData service.
Annotation techniques can't be used.
I 'hacked' something that is misusing a formatter to update the type of a binding. But this is 'a hack' and it is not possible to convert it to XML views. (The reason is a different handling of the scope the formatter will be called).
So I am searching for a working solution for XML views.
The following code would not work but shows the issue:
new sap.m.Input({ // looking for an XML solution with bindings value: { path: "Quantity", type: new sap.ui.model.type.Float({ // formatOptions maxFractionDigits: "{QuantityDecimals}", // ... }, { // constraints minimum: 0 }), // ... } });
The maxFractionDigits : "{QuantityDecimals}"
should be "dynamic" and not a constant value.