If a row in the GridComponent is being edited and contains errors (e.g., a required field is left blank), it is possible to switch to a different row, causing the GUI to enter an inconsistent state:
- A message correctly appears stating that the changes cannot be saved.
- The old row continues to display fields but is no longer selected.
- The new row is selected but does not display any fields.
Another scenario
If a composition reference is displayed as a column in a GridComponent, it can be edited inline using “Show Values.” If input errors are made here (e.g., required fields are left blank) and the dialog is closed, an error icon is displayed in the column and the row object cannot be saved because “an internal field has an error”:
Problem
However, if in this situation the “Save” function is not explicitly used, but the row is simply changed (which normally saves the changes implicitly), the new row is selected without entering edit mode, but the display of the previously selected row is not updated, so that it continues to be displayed in edit mode. If you now exit edit mode by clicking “Cancel,” the display of the previously selected row still does not update, and it continues to be shown in edit mode:
If you then switch back to edit mode to edit the newly selected row, both rows are displayed in edit mode:
Should
Switching rows should either be impossible until the error has been corrected by fixing or discarding the input, or the input must be automatically discarded when switching rows, or at the very least, selecting "Cancel" must also exit edit mode for non-selected rows.
Test
- TestGridSelection-04_TestChangeSelectionInErrorState.script.xml
- Manual:
- Go to Structures > Type Demo > Grid.
- Edit an "A" and clear the name.
- Expected: The row has an error
- Click on another row.
- Expected behavior: It is not possible to switch to a different row. The old row is still being edited and retains the old error. Only the row being edited is selected.
- Check the selection checkbox for another row.
- Expected behavior: It is not possible to switch rows. The previous row remains active and retains the previous error. Only the row being edited is selected.