Skip to Content

Binding Input of type Float to JSONModel always returns a string instead of a number

Hello Everyone,

I want to simply bind a number value to an input field. However, I just cannot get this to work properly.

I have an input field which is bound to a JSONModel, where the value behind is a js number.

<Input value="{path: '/myValue', type : 'sap.ap.ui.model.type.Float' }" type="Number"/>

However, everytime I edit the value of the input field, the JSON Model no longer holds a number, but a string like "1.2" instead of the number 1.2

How can I directly bind the number value to the input field, without having to manually convert afterwards?

Thanks in advance and best regards,

Chris

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Mar 23 at 10:09 AM

    Hi,

    Use StepInput control for number input.

    https://sapui5.hana.ondemand.com/#/entity/sap.m.StepInput

    Regards,

    Gururaj

    Add comment
    10|10000 characters needed characters exceeded