Hi,
Setting the edit value of a DATE or DATETIME field does not work when the field is not currently visible in the ListGrid.
It does always work for other field types, for DATE and DATETIME fields it only works when the field is visible.
I would expect the behavior of setEditValue on fields that are not visible to be the same for all field types.
Context:
SmartClient Version: v12.1p_2020-12-02/LGPL Development Only (built 2020-12-02)
GWT Version: 2.9.0
Tested in Super Dev mode and compiled mode.
Behavior is the same across the following browsers:
Chrome - 87.0.4280.66
Firefox - 82.0.3
Edge
Test case:
A grid is created with a client-only datasource that contains one record with default values for fields of types DATE, DATETIME, INTEGER, and TEXT.
A button is added that sets the edit values of all 4 fields.
Steps taken:
Setting the edit value of a DATE or DATETIME field does not work when the field is not currently visible in the ListGrid.
It does always work for other field types, for DATE and DATETIME fields it only works when the field is visible.
I would expect the behavior of setEditValue on fields that are not visible to be the same for all field types.
Context:
SmartClient Version: v12.1p_2020-12-02/LGPL Development Only (built 2020-12-02)
GWT Version: 2.9.0
Tested in Super Dev mode and compiled mode.
Behavior is the same across the following browsers:
Chrome - 87.0.4280.66
Firefox - 82.0.3
Edge
Test case:
A grid is created with a client-only datasource that contains one record with default values for fields of types DATE, DATETIME, INTEGER, and TEXT.
A button is added that sets the edit values of all 4 fields.
Steps taken:
- Use the grid header context menu to hide all columns except the PK field.
- Click the 'setEditValue' button at the bottom of the page.
- Use the grid header context menu to make all columns visible again.
- The edit values of the INTEGER and TEXT fields have been correctly set, the edit values of the DATE and DATETIME fields have not been set.
Code:
public class TestEntryPoint extends SmartGwtEntryPoint { @Override public void onModuleLoad() { DataSource dataSource = new DataSource(); dataSource.setClientOnly(true); DataSourceField idField = new DataSourceField("id", FieldType.INTEGER, "PK"); idField.setPrimaryKey(true); DataSourceField datetimeField = new DataSourceField("datetime", FieldType.DATETIME, "Datetime"); DataSourceField dateField = new DataSourceField("date", FieldType.DATE, "Date"); DataSourceField intField = new DataSourceField("int", FieldType.INTEGER, "Integer"); DataSourceField textField = new DataSourceField("text", FieldType.TEXT, "Text"); dataSource.setFields(idField, datetimeField, dateField, intField, textField); ListGridRecord[] testData = new ListGridRecord[1]; testData[0] = new ListGridRecord(); testData[0].setAttribute("id", 0); testData[0].setAttribute("datetime", new Date(0)); testData[0].setAttribute("date", new Date(0)); testData[0].setAttribute("int", 0); testData[0].setAttribute("text", "original"); dataSource.setCacheData(testData); ListGrid grid = new ListGrid(); grid.setDataSource(dataSource); grid.fetchData(); Button testButton = new Button("setEditValue"); testButton.addClickHandler((event) -> { grid.setEditValue(0, "datetime", new Date()); grid.setEditValue(0, "date", new Date()); grid.setEditValue(0, "int", 1); grid.setEditValue(0, "text", "modified"); }); VLayout layout = new VLayout(); layout.setWidth100(); layout.setHeight100(); layout.setMembers(grid, testButton); layout.draw(); } }
Comment