Home Reference Source
import Wizard from 'formiojs/src/Wizard.js'
public class | source

Wizard

Extends:

src/components/_classes/nesteddata/NestedDataComponent.js~NestedDataComponentWebform → Wizard

Constructor Summary

Public Constructor
public

constructor(element: *, options: Object)

Constructor for wizard based forms

Member Summary

Public Members
public get

buttons: *

public
public

components: *[]

public
public get
public
public get

data: *

public set
public
public

element: *

public get

errors: *

public get

form: *

public set
public
public
public
public

pages: *[]

public
public get

renderContext: {"wizardKey": *, "isBreadcrumbClickable": *, "panels": *, "buttons": *, "currentPage": *}

public get

schema: *

public
public

wizard: *

public get
Private Members
private

Method Summary

Public Methods
public
public

attach(element: *): *

public
public
public

beforePage(next: *): *

public
public

cancel(noconfirm: *): *

public

checkValidity(data: *, dirty: *, row: *, currentPageOnly: *): *

public
public
public

establishPages(data: *): *

public

focusOnComponent(key: *): *

public
public
public

getPageIndexByKey(key: *): *

public

getPages(args: {}): *

public
public

hasButton(name: *, nextPage: *): boolean

public

init(): *

public
public

isClickable(page: *, index: *): *

public

isLastPage(): *

public

nextPage(): *

public

onChange(flags: *, changed: *, modified: *, changes: *)

public

pageFieldLogic(page: *)

public

pageId(page: *): *

public
public
public

prevPage(): *

public
public
public

render(): *

public
public
public

setForm(form: *, flags: *): *

public

setPage(num: *): *

public

setValue(submission: *, flags: {}): *

Inherited Summary

From class Webform
public get
public get

form: Object: *

Gets the form object.

public set

form(form: Object)

Sets the form value.

public set

language(lang: *): Promise

Sets the language for this form.

public get

Returns if this form is loading.

public set

loading(loading: boolean)

Set the loading state for this form, and also show the loader spinner.

public get
public set
public get

Called when both the form and submission have been loaded.

public get

schema: *

public get

src: string: *

Get the embed source of the form.

public set

src(value: string)

Set the Form source, which is typically the Form.io embed URL.

public get

Returns the submission object that was set within this form.

public set

submission(submission: Object)

Sets the submission of a form.

public get

url: string: *

Get the embed source of the form.

public set

url(value: string)

Set the form source but don't initialize the form and submission from the url.

public

alert: HTMLElement

The alert HTML element

public
public

components: *[]

public
public
public
public

editing: *

public

element: *

public
public

Promise that executes when the form is ready and rendered.

public

Called when this form could not load and is rejected.

public

Called when the formReady state of this form has been resolved.

public

The Formio instance for this form.

public
public

loader: HTMLElement

The loader HTML element.

public
public

Promise that is triggered when the submission is done loading.

public

options: *

public
public

root: *

public
public

shortcuts: *[]

public

Promise that executes when the submission is ready and rendered.

public

Called when this form could not load and is rejected.

public

Called when the formReady state of this form has been resolved.

public

Determines if this submission is explicitly set.

public

Determines if the form has tried to be submitted, error or not.

public

Determines if the form is being submitted at the moment.

public
public

The type of this element.

private

_form: {}

private
private
private
private
public

addLanguage(code: *, lang: *, active: *): *

Add a language for translations

public

addShortcut(element: *, shortcut: *)

public

attach(element: *): *

public

build(element: *): *

public

cancel(noconfirm: *): boolean

Cancels the submission.

public

checkData(data: *, flags: {}): *

public

Send a delete request to the server.

public

destroy(deleteFromGlobal: boolean): *

public
public

executeSubmit(options: *): *

public

Focus on selected component.

public
public

getValue(): *

public
public

init(): *

Build the form.

public
public

Loads the submission if applicable.

public

localize(): *

Perform the localization initialization.

public

mergeData(_this: *, _that: *)

public

onChange(changed: *, flags: *)

Trigger the change event for this form.

public

Called when an error occurs during the submission.

public

onSubmit(submission: Object, saved: boolean): object

Called when the submission has completed, or if the submission needs to be sent to an external library.

public

redraw(): *

public

removeShortcut(element: *, shortcut: *)

public

render(): *

public
public

restoreDraft(-: userId)

Restores a draft submission based on the user who is authenticated.

public

Saves a submission draft.

public

setAlert(type: string, message: string, classes: string)

Sets a new alert to display in the error dialog of the form.

public

setForm(form: Object): *

Sets the JSON schema for the form to be rendered.

public

setMetadata(submission: *)

public

setSrc(value: *, options: *): *

Set the src of the form renderer.

public

setSubmission(submission: *, flags: *): Promise<TResult>

Sets a submission and returns the promise when it is ready.

public

setUrl(value: *, options: *): boolean

Sets the url of the form renderer.

public

setValue(submission: *, flags: {}): *

public

showErrors(error: Object): *

Show the errors of this form within the alert dialog.

public

submit(before: boolean): Promise

Submits the form.

public

submitForm(options: {}): *

public

submitUrl(URL: *, headers: *): *

public

Public Constructors

public constructor(element: *, options: Object) source

Constructor for wizard based forms

Override:

Webform#constructor

Params:

NameTypeAttributeDescription
element *

Dom element to place this wizard.

options Object

Options object, supported options are:

  • breadcrumbSettings.clickable: true (default) determines if the breadcrumb bar is clickable or not
  • buttonSettings.show*(Previous, Next, Cancel): true (default) determines if the button is shown or not

Public Members

public get buttons: * source

public component: * source

Override:

Webform#component

public components: *[] source

Override:

Webform#components

public currentNextPage: number source

public get currentPage: * source

public currentPanel: * source

public get data: * source

public set data source

public disabled: * source

public element: * source

Override:

Webform#element

public get errors: * source

public get form: * source

Gets the form object.

Override:

Webform#form

public set form source

Gets the form object.

Override:

Webform#form

public originalComponent: * source

public originalComponents: *[] source

public page: number source

public pages: *[] source

public prefixComps: *[] source

public get renderContext: {"wizardKey": *, "isBreadcrumbClickable": *, "panels": *, "buttons": *, "currentPage": *} source

public get schema: * source

Override:

Webform#schema

public suffixComps: *[] source

public wizard: * source

public get wizardKey: string source

Private Members

private _seenPages: number[] source

Public Methods

public addComponents() source

public attach(element: *): * source

Override:

Webform#attach

Params:

NameTypeAttributeDescription
element *

Return:

*

public attachHeader() source

public attachNav() source

public beforePage(next: *): * source

Params:

NameTypeAttributeDescription
next *

Return:

*

public beforeSubmit(): * source

Return:

*

public cancel(noconfirm: *): * source

Cancels the submission.

Override:

Webform#cancel

Params:

NameTypeAttributeDescription
noconfirm *

Return:

*

public checkValidity(data: *, dirty: *, row: *, currentPageOnly: *): * source

Params:

NameTypeAttributeDescription
data *
dirty *
row *
currentPageOnly *

Return:

*

public detachHeader() source

public detachNav() source

public establishPages(data: *): * source

Params:

NameTypeAttributeDescription
data *
  • optional

Return:

*

public focusOnComponent(key: *): * source

Focus on selected component.

Override:

Webform#focusOnComponent

Params:

NameTypeAttributeDescription
key *

Return:

*

public getComponents(): * source

Return:

*

public getNextPage(): * source

Return:

*

public getPageIndexByKey(key: *): * source

Params:

NameTypeAttributeDescription
key *

Return:

*

public getPages(args: {}): * source

Params:

NameTypeAttributeDescription
args {}
  • optional
  • default: {}

Return:

*

public getPreviousPage(): * source

Return:

*

public hasButton(name: *, nextPage: *): boolean source

Params:

NameTypeAttributeDescription
name *
nextPage *
  • optional

Return:

boolean

public init(): * source

Build the form.

Override:

Webform#init

Return:

*

public isBreadcrumbClickable(): * source

Return:

*

public isClickable(page: *, index: *): * source

Params:

NameTypeAttributeDescription
page *
index *

Return:

*

public isLastPage(): * source

Return:

*

public nextPage(): * source

Return:

*

public onChange(flags: *, changed: *, modified: *, changes: *) source

Trigger the change event for this form.

Override:

Webform#onChange

Params:

NameTypeAttributeDescription
flags *
changed *
modified *
changes *

public pageFieldLogic(page: *) source

Params:

NameTypeAttributeDescription
page *

public pageId(page: *): * source

Params:

NameTypeAttributeDescription
page *

Return:

*

public prepareHeaderSettings(ctx: *): * source

Params:

NameTypeAttributeDescription
ctx *

Return:

*

public prepareNavigationSettings(ctx: *): * source

Params:

NameTypeAttributeDescription
ctx *

Return:

*

public prevPage(): * source

Return:

*

public redrawHeader() source

public redrawNavigation() source

public render(): * source

Override:

Webform#render

Return:

*

public resetValue() source

Override:

Webform#resetValue

public setComponentSchema() source

public setForm(form: *, flags: *): * source

Sets the JSON schema for the form to be rendered.

Override:

Webform#setForm

Params:

NameTypeAttributeDescription
form *
flags *

Return:

*

public setPage(num: *): * source

Params:

NameTypeAttributeDescription
num *

Return:

*

public setValue(submission: *, flags: {}): * source

Override:

Webform#setValue

Params:

NameTypeAttributeDescription
submission *
flags {}
  • optional
  • default: {}

Return:

*