In the example below the validation of the field fails even though the format on the date field is set correctly.
Have we missed something on the DataSourceDateField setup or we stumbled upon a bug?
Have we missed something on the DataSourceDateField setup or we stumbled upon a bug?
Code:
private static final ListGridRecord[] RECORDS = { mkRecord(1, "test"), mkRecord(0, "test2"), mkRecord(2, "test2"), mkRecord(4, "test4") }; @Override public void onModuleLoad() { VLayout layout = new VLayout(); RootPanel.get().add(layout); DataSource dataSource = new DataSource(); dataSource.setClientOnly(true); dataSource.setTestData(RECORDS); DataSourceField sequenceField = new DataSourceSequenceField("id", "ID"); sequenceField.setRequired(true); DataSourceField textField = new DataSourceTextField("textField", "Text Field"); DataSourceField dateField = new DataSourceDateField("dateField", "Date Field"); dateField.setFormat("dd/MM/yyyy"); dataSource.setFields(sequenceField, textField, dateField); ListGrid listGrid = new ListGrid(dataSource); listGrid.setSize("500", "200"); listGrid.setCanEdit(true); listGrid.setAutoFetchData(true); layout.addMember(listGrid); Button button = new Button("add"); button.addClickHandler(h -> listGrid.startEditingNew()); layout.addMember(button); } private static final ListGridRecord mkRecord(int id, String textField) { final ListGridRecord record = new ListGridRecord(); record.setAttribute("id", id); record.setAttribute("textField", textField); return record; }
Comment