on 01-17-2017 1:09 PM
Hi Friends,
in sap.m.table I have a number field. As long it is not touched it stays a number. But when I change it, it becomes a string. Is this normal or can I avoid it in any way?
Thanks Joerg
Thanks Viplove,
but sap.m.table expecting sap.m.input and furthermore number, email etc.
But at least, now it works when I parse the string in "change" event and set true in refresh.
oChartModel.refresh();
now.
oChartModel.refresh(true);
Rg. Joerg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joerg Arndt,
Actually when we bind the property of a control , we have data type for that binding (sap.ui.model.type.<String/Float/Integer..>). I think you need to set that as Integer.
Check out this link for Data Types.
Thanks
Viplove
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sergio,
it is sap.m.Input with Number format.
In Model under properties I can see the Format is number but the value is changed string like "786". I have function "change" to update a chart. Where I can parse it to number. I managed it once to change the chart while change the values by hand. But I can not make agen.
I tried it like this.
var newValue = parseInt(oEvent.mParameters.newValue);
var oField = sap.ui.getCore().byId(fieldId);
oField.setValue(newValue);
or
var oChartModel = sap.ui.getCore().getModel("CHARTMODEL");
var chartdata = oChartModel.getData();
chartdata.results[0].SEATSMAX = newValue;
oChartModel.setData(chartdata);
oChartModel.refresh();
Both, the chart is not updated.
How is it possible that the value in the Model is changed to string.
I have the same propblem when I want to save data to database. But here I can convert it back to number.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
is your control (number field) a text control? an input control? you could probably force it by using a liveChange event and then running on a formatter function
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.