Class ModalDef.Field
java.lang.Object
org.apache.juneau.console.widgets.ModalDef.Field
- Enclosing class:
- ModalDef
A single typed confirmation field: a label and a value, painted client-side with
textContent (never
innerHTML).- Since:
- 10.0.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ModalDef.FieldCreates a typed confirmation field displayed as monospaced, copyablecode.static ModalDef.FieldCreates a typed confirmation field.
-
Field Details
-
label
The field label shown to the user. -
value
The field value, read back from the current authoritative record. -
kind
How this field's value is displayed; omitted from the wire when unset (which reads astext).The allowlist is exactly
textandcode;ModalDef.validate()rejects anything else server-side, and the runtime falls back totextfor an unrecognized token rather than trusting it.This is a display kind on a confirmation field, deliberately not a new
FormDef.Inputtype: acodefield 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
-
Field
public Field()
-
-
Method Details
-
of
Creates a typed confirmation field.- Parameters:
label- The field label. Must not benull or blank.value- The field value. Can benull (rendered as an empty value).- Returns:
- A new
ModalDef.Field. - Throws:
IllegalArgumentException- Iflabelisnull or blank.
-
code
Creates a typed confirmation field displayed as monospaced, copyablecode.The runtime paints the value into a
<pre>withtextContent(neverinnerHTML) 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 benull or blank.value- The field value. Can benull (rendered as an empty value).- Returns:
- A new
ModalDef.Field. - Throws:
IllegalArgumentException- Iflabelisnull or blank.
-