Hello,
I have following simple code
FloatItem i = new FloatItem();
i.setFormatOnBlur(true);
i..setValueFormatter(new FormItemValueFormatter() {
@Override
public String formatValue(Object value, Record record, DynamicForm form, FormItem item) {
//do magic formatting
}
});
and I encounter strange behaviour that field is updated to proper value that I create in handler, but just for a while. Callback FormItemValueFormatter is called in onblur event - OK
but value is than quickly changed to other value with editorexit event when mapValueToDisplay of FloatItem is called - NOT OK.
This one does not respect value I have created. And it uses internal formatter from this.formatter property or some default from this._simpleType that actually breaks formatting (I have checked sources you provide).
Maybe I have miss-understood the api but I expect that value provided in setValueFormatter is used for final display. In my case it is not. this._simpleType is used instead and formats value to something else.
Workaround would be to extend FloatItem and override mapDisplayToValue. but I do not want to do so until it is totally necessary.
So I am kindly asking for clarification.
Thanks in advance
smartclient version v11.0p_2017-01-21
browsers: all
I have following simple code
FloatItem i = new FloatItem();
i.setFormatOnBlur(true);
i..setValueFormatter(new FormItemValueFormatter() {
@Override
public String formatValue(Object value, Record record, DynamicForm form, FormItem item) {
//do magic formatting
}
});
and I encounter strange behaviour that field is updated to proper value that I create in handler, but just for a while. Callback FormItemValueFormatter is called in onblur event - OK
but value is than quickly changed to other value with editorexit event when mapValueToDisplay of FloatItem is called - NOT OK.
This one does not respect value I have created. And it uses internal formatter from this.formatter property or some default from this._simpleType that actually breaks formatting (I have checked sources you provide).
Maybe I have miss-understood the api but I expect that value provided in setValueFormatter is used for final display. In my case it is not. this._simpleType is used instead and formats value to something else.
Workaround would be to extend FloatItem and override mapDisplayToValue. but I do not want to do so until it is totally necessary.
So I am kindly asking for clarification.
Thanks in advance
smartclient version v11.0p_2017-01-21
browsers: all
Comment