Hi,
After used smartgwtpro-6.0p ,the floatitem had a problem. When I input some digit,but only the first digit is showed,after forcus exit the floatitem. As shown attached picture,and code is:
FloatItem deliveryUnitLenItem = new FloatItem();
deliveryUnitLenItem.setName("deliveryUnitLen");
deliveryUnitLenItem.setTitle(SmartQuote.multiLan.deliveryUnitLen());
deliveryUnitLenItem.setDecimalPrecision(4);
//deliveryUnitLenItem.setDecimalPad(2);
deliveryUnitLenItem.setEditorValueFormatter(new FormItemValueFormatter(){
@Override
public String formatValue(Object value, Record record,
DynamicForm form, FormItem item) {
if (value == null) return null;
String val = null;
try {
//System.out.println("value:"+value.toString());
NumberFormat df = NumberFormat.getFormat("#0.0000");
val = df.format(((Number) value).doubleValue());
} catch (Exception e) {
return value.toString();
}
return val;
}
});
Why? before use smartgwtpro-6.0p ,the codes work ok.
Thanks!
Kingdom
After used smartgwtpro-6.0p ,the floatitem had a problem. When I input some digit,but only the first digit is showed,after forcus exit the floatitem. As shown attached picture,and code is:
FloatItem deliveryUnitLenItem = new FloatItem();
deliveryUnitLenItem.setName("deliveryUnitLen");
deliveryUnitLenItem.setTitle(SmartQuote.multiLan.deliveryUnitLen());
deliveryUnitLenItem.setDecimalPrecision(4);
//deliveryUnitLenItem.setDecimalPad(2);
deliveryUnitLenItem.setEditorValueFormatter(new FormItemValueFormatter(){
@Override
public String formatValue(Object value, Record record,
DynamicForm form, FormItem item) {
if (value == null) return null;
String val = null;
try {
//System.out.println("value:"+value.toString());
NumberFormat df = NumberFormat.getFormat("#0.0000");
val = df.format(((Number) value).doubleValue());
} catch (Exception e) {
return value.toString();
}
return val;
}
});
Why? before use smartgwtpro-6.0p ,the codes work ok.
Thanks!
Kingdom
Comment