enhancement
major
minor
major
minor
minor
#29496
React table: a column resize is rejected with "Integer value expected" and the new width is lost when the client sends a fractional width
Reported from the Consulting application on 8.0.0-alpha7 (react view UI, Issue #94).
What happens
Dragging a column border in a TableViewControl table sometimes ends with a short message at the bottom of the page, //"Integer value expected"// (German: //"Ganzzahl erwartet"//), that closes itself. The column keeps the dragged width in the browser, but the width is not stored: after a reload the column shows its old width again.
The message comes from the server: the columnResize command declares its argument as int:
com.top_logic.layout.react.control.table.ColumnResizeArguments String getColumn(); int getWidth();
and the client sends the width it measured. The resize handler computes Math.max(minWidth, startWidth + dx + scroll) from DOM measurements and pointer coordinates, and under browser zoom or fractional HiDPI scaling that value is not an integer (a width of 626.852px was measured on a real column). The server binds the command arguments into the typed argument item, refuses the fractional value with ERROR_INTEGER_EXPECTED, shows the failure in the snackbar and drops the resize.
The problem is not reproducible at 100 % zoom on a display with integral scaling, which is why the original report could not be repeated.
Argument validation
The original report assumed the server accepts invalid arguments (147.85, null, a missing value, "x") because POST /react-api/command answers success: true for all of them. That is by design: a command failure is shown to the user in the snackbar, the HTTP answer is success: true regardless. The binding of the arguments (ReactControl.bindArguments, JsonConfigurationReader plus the mandatory and primitive checks of the typed configuration) rejects every one of these values; no invalid value reaches the table or the personalization. The same holds for columnReorder and its targetIndex.
Lösung
- The client rounds the width it sends at the end of a resize drag. The fit-to-content path already sends an integral width, and the reorder index is always an integer.
- The server keeps rejecting malformed arguments; this is the correct contract.
- A regression test in tl-layout-react sends columnResize and columnReorder with fractional, null, missing and non-numeric arguments through TableViewControl.executeCommand and asserts a failure result with the column state unchanged, and that an integral width is applied.