Package su.onno.ui

Class InputSpec

java.lang.Object
su.onno.ui.InputSpec

public final class InputSpec extends Object
Declares custom input fields for an entity's list toolbar, from 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.