Hello, I have a textfield with a converted that must accept only doubles, I would like that after a change the value on the textfield, the value changes to the correct format, example: 1234.56 onblur change it to: 1,234.56 . there is a way to trigger the convertToPresentation method on the converter?
I did it like this, but Im not sure if the correct way:
this.addBlurListener(new FieldEvents.BlurListener() {
@Override public void blur(FieldEvents.BlurEvent blurEvent) {
NumberFieldWidget nf = (NumberFieldWidget)blurEvent.getComponent();
if(nf.isValid()){
double d= (double)nf.getConvertedValue();
nf.setValue(Double.toString(d));
}
}
});