Class ModalDef.ChildAction

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

@BeanType(properties="id,label,form,endpoint,method,onSuccess,carryDrafts") public static class ModalDef.ChildAction extends Object
One entry in a dialog's ModalDef.childActions catalog — a stacked step a type="action" input inside this dialog's form may open.
Dialog-presenting by construction

A child action carries no present field: opening a stacked dialog is the only thing it does. A child with no form is a legal confirm-only child dialog.

No gating vocabulary, on purpose

There is deliberately no enabledWhen here, for three independent reasons. The rule type lives in the rich-view module, which this module must not reference. A dialog opened where there is no row has no row data to evaluate against, so a field-keyed rule would fail closed forever with no signal to its author. And the subject of a child step is the draft in the open dialog, not the parent row — so evaluating the parent row's data would answer a question nobody asked. Gating a child step is the server's job at child-form-GET time; it already owns that GET and can refuse it.

Since:
10.0.0
  • Field Details

    • id

      public String id
      The action id a type="action" input in this dialog's form names. Required, non-blank.
    • label

      public String label
      The label painted on the button that opens this child. Required, non-blank.
    • form

      public String form
      The child dialog's read-only form-source URL; omitted from the wire when unset (a confirm-only child).

      Required if this child declares carryDrafts — with no URL there is nothing for the draft query to ride on, so the drafts would vanish silently.

    • endpoint

      public String endpoint
      The child's submit endpoint; omitted from the wire when unset. See endpoint(String).
    • method

      public String method
      The child's submit method; omitted from the wire when unset. See method(String).
    • onSuccess

      public String onSuccess
      The child's on-success behaviour token; omitted from the wire when unset.
    • carryDrafts

      Whether opening this child carries the parent dialog's current draft values to its form-source GET as one query parameter; omitted from the wire when unset or false.

      Without it a Review step opens empty and loses everything the operator typed. With it, the runtime serializes the parent's collected form values, URL-encodes them, and appends them as a single juneauDrafts parameter, refusing visibly (and not opening the child) above a client-side byte cap measured on the encoded value.

      Drafts land in access logs and browser history. No secret may ride this channel.

  • Constructor Details

  • Method Details

    • of

      public static ModalDef.ChildAction of(String id, String label)
      Creates a child action.
      Parameters:
      id - The action id a type="action" input names. Must not be null or blank.
      label - The button label. Must not be null or blank.
      Returns:
      A new ModalDef.ChildAction.
      Throws:
      IllegalArgumentException - If id or label is null or blank.
    • form

      Sets the child dialog's read-only form-source URL.
      Parameters:
      value - The URL. Can be null to unset (a confirm-only child).
      Returns:
      This object.
    • endpoint

      Sets the child's submit endpoint.

      Optional individually; a child action whose dialog is meant to be submittable must declare both a non-safe method and an endpoint, or its Confirm visibly refuses with safe-method and sends nothing. A display-only child that never submits needs neither, which is why this is not a ModalDef.validate() rule — this bean cannot know which of its children are meant to submit.

      Parameters:
      value - The endpoint. Can be null to unset.
      Returns:
      This object.
    • method

      Sets the child's submit method.

      Optional individually; see endpoint(String) — a submittable child needs both, and a missing or safe method is a visible client-side refusal before any request is sent.

      Parameters:
      value - The method. Can be null to unset.
      Returns:
      This object.
    • onSuccess

      Sets the child's on-success behaviour token.
      Parameters:
      value - The token. Can be null to unset.
      Returns:
      This object.
    • carryDrafts

      public ModalDef.ChildAction carryDrafts(boolean value)
      Declares that opening this child carries the parent dialog's drafts (see carryDrafts).

      Passing false clears the flag rather than serializing an explicit false, so an un-opted-in child's payload is byte-identical to one that never mentioned it.

      Parameters:
      value - true to carry the parent's drafts; false (or unset) to open empty.
      Returns:
      This object.