Hello,
I have some problems when using FieldType.LOCALEFLOAT on FloatItem.
Float value is shown correctly in the UI but the validation fails.
This is my piece of code that is not working:
@Override
public void onModuleLoad() {
DynamicForm form = new DynamicForm();
form.setWidth100();
form.setHeight100();
FloatItem floatItem = new FloatItem("float", "Float Item");
floatItem.setValidateOnExit(true);
floatItem.setType(FieldType.LOCALEFLOAT.getValue());
floatItem.setValue(456.70);
DateItem dateItem = new DateItem("date", "Date Item");
dateItem.setUseTextField(true);
DateTimeFormat dtf = DateTimeFormat.getFormat("yyyy-mm-dd");
dateItem.setValue(dtf.parse("2034-12-25"));
dateItem.setValidateOnExit(true);
form.setItems(floatItem, dateItem);
form.draw();
}
Validation on date works fine in this case but validation on float fails every time, both if I use "," or "." .
I need to use float in locale format.
I use smartGWT 5.0 and I also tried 5.1 nightly build 24 March 2016.
Can you give me a solution to this problem?
Best regards.
I have some problems when using FieldType.LOCALEFLOAT on FloatItem.
Float value is shown correctly in the UI but the validation fails.
This is my piece of code that is not working:
@Override
public void onModuleLoad() {
DynamicForm form = new DynamicForm();
form.setWidth100();
form.setHeight100();
FloatItem floatItem = new FloatItem("float", "Float Item");
floatItem.setValidateOnExit(true);
floatItem.setType(FieldType.LOCALEFLOAT.getValue());
floatItem.setValue(456.70);
DateItem dateItem = new DateItem("date", "Date Item");
dateItem.setUseTextField(true);
DateTimeFormat dtf = DateTimeFormat.getFormat("yyyy-mm-dd");
dateItem.setValue(dtf.parse("2034-12-25"));
dateItem.setValidateOnExit(true);
form.setItems(floatItem, dateItem);
form.draw();
}
Validation on date works fine in this case but validation on float fails every time, both if I use "," or "." .
I need to use float in locale format.
I use smartGWT 5.0 and I also tried 5.1 nightly build 24 March 2016.
Can you give me a solution to this problem?
Best regards.
Comment