Skip to content

Inline editing in listings

Status: ✅ Implemented — class-level @InlineEditing

Let users fix values in a collection — stock counts, prices, flags — right where they see them: in the listing grid, without opening the detail form.

The default CRUD flow persists through the detail form: click the row, edit one field, save, go back. For quick tabular corrections across many rows that round-trip dominates the task. Editable table solves this for form collections (@InlineEditing on a List field); listings backed by a repository needed the same directness.

Annotate the AutoCrud class itself with @InlineEditing. Every data column becomes an editable input in place, and each committed cell persists its row immediately through CrudStore.save(...) — no explicit save button.

A row edited in place is an edit of a stored record, so a column whose value an edit never takes stays plain text: @ReadOnly, @EditableOnlyWhenCreating (typed once, on the creation form), the record’s id (@PrimaryKey, else a field named id), a @GeneratedValue and the optimistic-lock @Version.

@UI("/stock")
@Title("Stock (edit in place)")
@InlineEditing
public class StockCrud extends AutoCrud<StockItem> {
@Override
public GridLayout gridLayout() { return GridLayout.table; } // cell editing lives in the table layout
@Override
public CrudStore<StockItem> store() { /* … */ }
}

Stock listing with in-place editors

The editor per column is derived from the field’s real Java type — the same mapping as editable tables: text, integer/number, checkbox, enum combo, date/time pickers.

Under the hood each commit dispatches the crud’s update-row action with the edited row; AutoCrud loads the stored record the row names, lays the row over it and calls store().save(entity). It is guarded like the editor’s save: a @ReadOnly (or otherwise not writable) field keeps the stored value whatever the request carries, the record’s other fields survive (a row carries only its columns), an id with no stored record is refused — never inserted —, and the action exists only on a crud annotated @InlineEditing whose canEdit() is true (any other crud answers a crafted update-row with 403). Override updateRow(Map, HttpRequest) to customise persistence (auditing, a database-side partial update) — and keep those guarantees. The .NET ([InlineEditing]) and Python (@inline_editing) ports behave the same.

Use it for flat, operational collections where values change often and rows are simple. Keep the default detail-form flow when rows have nested data, cross-field validation, or when edits must be reviewed before persisting.

See it live in the Explorer: Inline editing on a CRUD listing