Class ModalDef.Field

java.lang.Object
org.apache.juneau.console.widgets.ModalDef.Field
Enclosing class:
ModalDef

@BeanType(properties="label,value,kind") public static class ModalDef.Field extends Object
A single typed confirmation field: a label and a value, painted client-side with textContent (never innerHTML).
Since:
10.0.0
  • Field Details

    • label

      public String label
      The field label shown to the user.
    • value

      public String value
      The field value, read back from the current authoritative record.
    • kind

      public String kind
      How this field's value is displayed; omitted from the wire when unset (which reads as text).

      The allowlist is exactly text and code; ModalDef.validate() rejects anything else server-side, and the runtime falls back to text for an unrecognized token rather than trusting it.

      This is a display kind on a confirmation field, deliberately not a new FormDef.Input type: a code field carries no submit value, so expressing it as an input would mean teaching the collection, validation, prefill and submit paths about a control that is not one.

  • Constructor Details

  • Method Details

    • of

      public static ModalDef.Field of(String label, String value)
      Creates a typed confirmation field.
      Parameters:
      label - The field label. Must not be null or blank.
      value - The field value. Can be null (rendered as an empty value).
      Returns:
      A new ModalDef.Field.
      Throws:
      IllegalArgumentException - If label is null or blank.
    • code

      public static ModalDef.Field code(String label, String value)
      Creates a typed confirmation field displayed as monospaced, copyable code.

      The runtime paints the value into a <pre> with textContent (never innerHTML) and adds a copy button that is feature-detected and never throws; the <pre> stays selectable, so manual copy always works.

      Parameters:
      label - The field label. Must not be null or blank.
      value - The field value. Can be null (rendered as an empty value).
      Returns:
      A new ModalDef.Field.
      Throws:
      IllegalArgumentException - If label is null or blank.