Class InputSpec
EntityView.inputs(InputSpec),
and the fields of an action-form modal (ActionSpec.ActionBuilder.form).
An input sits in the toolbar next to the custom action buttons. It doesn't filter the list on
its own — instead its current value is handed to the ActionSpec handlers via
ActionContext.input(String) when a button is clicked. So you might add an "As of" date and
a "Reason" text field, then a "Generate report" button whose handler reads both.
public void inputs(InputSpec in) {
in.input("asOf").label("As of").type(InputType.DATE);
in.input("currency").label("Currency").type(InputType.SELECT).options("USD", "EUR").value("USD");
in.input("reason").label("Reason").type(InputType.TEXT).placeholder("optional");
}
Inside an action form (not a toolbar), an input may also be a repeatable row group — a
small tabular grid the user adds/removes rows in, each row a set of typed columns (a transient
analogue of a document @TabularSection). The handler reads the collected rows via
ActionContext.inputRows(String):
a.action("receive").label("Receive shipment").scope(ActionScope.TOOLBAR)
.form(f -> f
.input("note").label("Note")
.group("lines", g -> g.label("Lines").required()
.column("product", c -> c.label("Product").required())
.column("qty", c -> c.label("Qty").type(InputType.NUMBER).required())))
.handler(ctx -> {
for (var row : ctx.inputRows("lines")) receive(row.get("product"), row.get("qty"));
return ActionResult.refresh(ActionToast.success("Received"));
});
Groups are an action-form feature only; a list toolbar renders scalar inputs and ignores any declared groups. In the modal, scalar fields render first, then the row groups.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordPresentation metadata for an action-form dialog.static final classFluent builder for a repeatablerow group.static final classFluent builder for one input; setters may be called in any order.static final recordA resolved toolbar (or action-form) input field.static final recordA resolved action-form row group: a repeatable row ofcolumns. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncancelLabel(String cancelLabel) description(String description) Supporting copy shown beneath the action-form dialog title.group(String key, Consumer<InputSpec.GroupBuilder> body) Declare a repeatable row group (action forms only) with the given unique key — the modal renders an add/remove grid of the columns configured inbody, and the handler reads the rows viaActionContext.inputRows(String).groups()The declared row groups (action forms only), in declaration order.Start declaring an input with the given unique key (how the handler reads its value).inputs()size(DialogSize size) submitLabel(String submitLabel) Action-form dialog title.tone(ActionSeverity tone)
-
Constructor Details
-
InputSpec
public InputSpec()
-
-
Method Details
-
title
Action-form dialog title. Has no effect when this spec is used for list-toolbar inputs. -
description
Supporting copy shown beneath the action-form dialog title. -
submitLabel
-
cancelLabel
-
icon
-
tone
-
size
-
input
Start declaring an input with the given unique key (how the handler reads its value). -
group
Declare a repeatable row group (action forms only) with the given unique key — the modal renders an add/remove grid of the columns configured inbody, and the handler reads the rows viaActionContext.inputRows(String). Ignored by a list toolbar, which has no grid widget. -
inputs
-
groups
The declared row groups (action forms only), in declaration order.
-