Skip to content

ActionForm

Overview

Form shell that executes a server action, handles dry-run validation, shows success/error toasts, and provides confirm and cancel button slots.

Renders a pinned actions strip (confirm + cancel + optional hint) and, when the form has unresolved per-field errors, a structured validation alert sourced from formContext.state.errors. Also mounts a FormConfirmDialog bound to the action's confirmation controller, so actions the server gates behind warning acknowledgement (HTTP 409) can be confirmed and retried. ActionForm renders no warnings content of its own; a consumer that needs to render them (e.g. a bulk action grouping per-object warnings by their display name) supplies the form-confirm-dialog-warnings slot, which forwards FormConfirmDialog's warnings slot scope (warnings, the controller's raw warnings mapping). Without that slot, FormConfirmDialog's own default rendering shows through.

Theme entry: ActionForm

Props

NameTypeRequiredDefaultDescription
iconOverrideObjectnullA partial icon registry ({ [componentName]: { [iconName]: { component, props } } }) merged with inherited and default icon entries; scopes icon overrides to this component and its descendants.
themeOverrideString|Object|ArraynullA partial theme object merged with the component's default theme; accepts a class string, class array, or theme object.
runActionfuncundefinedFunction to execute the action.
actionSuccessSummarystringundefinedToast summary text shown when the action succeeds.
actionErrorSummarystringundefinedToast summary text shown when the action fails.
confirmMessagestringundefinedConfirmation message displayed to the user before executing the action (reserved for future use).
fetchStateobject{ errored: false, error: null, loading: undefined }Reactive state object describing the data-fetch status (errored, error, loading).
actionStateobject{ errored: false, error: null, loading: undefined }Reactive state object describing the action execution status (errored, error, loading).
hasInputbooleanfalseWhether the form has user input fields that must be validated before submission.
redirectTofuncundefinedAsync function called to navigate away after a successful action or cancel; receives "success" or "cancel" as its argument.
onSubmissionSuccessHandlerfuncundefinedCustom handler called on successful submission in place of the default success toast and redirect.
onSubmissionErrorHandlerfuncundefinedCustom handler called on submission error in place of the default error toast.
onSubmissionWarningsRequireConfirmationfuncundefinedCustom handler called when the server requires confirmation of warnings (HTTP 409) in place of the default render-warnings-and-prompt behaviour.
readyToDryRunbooleanfalseWhen set to true, triggers a dry-run validation pass without submitting the form.
dryRunTargetstringundefinedIdentity of the current dry-run target (e.g. useModelAction's joined pks). The dry-run watcher latches on this, firing once per distinct value rather than every time readyToDryRun recomputes to true. Omit it for a caller with no target concept; the watcher then fires at most once, ever.
requireModifiedbooleantrueWhen false, skips the "no changes detected" guard. Defaults to true. Set to false for forms that start empty where modification is not a meaningful concept.

Slots

NameScopedDescription
action-form-inneryes
validation-summaryyesOverride the structured per-field validation alert shown when formContext.state.anyError is set; receives entries, count, and title.
action-baryes
confirm-buttonyes
cancel-buttonyes
actions-hint
form-confirm-dialog-warningsyes

Full slot reference

Source

client/lib/views/ActionForm.vue

Documents matching: server v3.0.0a1.post1client v3.0.0-alpha.2