Form

Form

new Form()

Description:
  • Form Object

Source:

Extends

Members

(readonly) attributes

Description:
  • Returns the object attributes

Source:
Inherited From:

Returns the object attributes

(readonly) changedFields :Array.<string>

Description:
  • Returns an array of field names that their values have been changed

Source:

Returns an array of field names that their values have been changed

Type:
  • Array.<string>
Example
Form.changedFields

(readonly) container

Description:
  • The swat object top-level parent, usually a window or dialog object

Source:
Inherited From:

The swat object top-level parent, usually a window or dialog object

(readonly) controller :*

Description:
  • The object's legacy API controller. Used for JavaScript calls from TypeScript.

Source:
Inherited From:

The object's legacy API controller. Used for JavaScript calls from TypeScript.

Type:
  • *
Example
window.akioma.myFunction(eventSource.controller);

(readonly) dataSource :DataSource

Description:
  • The linked business entity to this form

Source:

The linked business entity to this form

Type:

(readonly) dynObject :*

Description:
  • The object's legacy API dynObject. Used for JavaScript calls from TypeScript.

Source:
Inherited From:

The object's legacy API dynObject. Used for JavaScript calls from TypeScript.

Type:
  • *
Example
window.akioma.myFunction(eventSource.dynObject);

(readonly) fieldNames :Array.<string>

Description:
  • An array containing the form field names, including nested fieldsets and block fields

Source:

An array containing the form field names, including nested fieldsets and block fields

Type:
  • Array.<string>

(readonly) name :string

Description:
  • The object name

Source:
Inherited From:

The object name

Type:
  • string

(readonly) parent :SwatObject

Description:
  • The swat object direct parent

Source:
Inherited From:

The swat object direct parent

Type:

(readonly) screen

Description:
  • The swat object inner screen (container)

Source:
Inherited From:

The swat object inner screen (container)

(readonly) topScreen

Description:
  • The swat object top screen (container), usually a window or dialog object

Source:
Inherited From:

The swat object top screen (container), usually a window or dialog object

type :string

Description:
  • Used for retriving the object type

Source:
Inherited From:

Used for retriving the object type

Type:
  • string

(readonly) window :Window

Description:
  • The swat object top-level window object. Note: Desktop windows are windows not frames so the window property of a child object in a desktop window will return the desktop window unlike the container property which will return the main desktop window for the application. Note: If the object is a window then it will returns itself.

Source:
Inherited From:

The swat object top-level window object. Note: Desktop windows are windows not frames so the window property of a child object in a desktop window will return the desktop window unlike the container property which will return the main desktop window for the application. Note: If the object is a window then it will returns itself.

Type:

Methods

addPanelMessage(msg) → {number}

Description:
  • Add an panel message and return the index of the message

Source:
Inherited From:
Parameters:
Name Type Description
msg PanelMessage

The panel message

Properties
Name Type Description
text string

The panel message text

type string

The panel message type i.e. info, warning, error, success

Returns:
Type
number

clearCustomState(name) → {void}

Description:
  • Remove a custom state from a controller

Source:
Inherited From:
Parameters:
Name Type Description
name string
Returns:
Type
void

clearHasChanges()

Description:
  • Clears hasChanges (dirty state)

Source:
Overrides:

clearPanelMessages() → {void}

Description:
  • Remove all panel messages from a controller

Source:
Inherited From:
Returns:
Type
void

decrementChanges() → {void}

Description:
  • Decrement has changes on a form with 1

Source:
Inherited From:
Returns:
Type
void

disableAllFields()

Description:
  • Helper method to disable all the form fields. Equivalent to looping through all the field names, getting the fields and setting enabled = false.

Source:

enableAllFields()

Description:
  • Helper method to enable all the form fields. Equivalent to looping through all the field names, getting the fields and setting enabled = true.

Source:

forceShow()

Description:
  • Forces the object to show. For example, if the object is in a collapsed panel, the panel is expanded or in an unselected tab, selects the object tab etc.

Source:
Inherited From:

getAllDataValues() → {*}

Description:
  • Returns an object with all the linked datasource form field values, including nested fieldsets and blocks

Source:
Returns:
Type
*

getAllScreenAndDataValues() → {*}

Description:
  • Returns an object with both the form fields screen and the datasource record fields

Source:
Returns:
Type
*

getAllScreenValues() → {*}

Description:
  • Returns an object with all the form fields screen values, including nested fieldsets and blocks

Source:
Returns:
Type
*

getAllValidationRules() → {*}

Description:
  • Returns all the form fields validation rules

Source:
Returns:

The validation rules

Type
*

getButton(name) → {akioma.swat.Button}

Description:
  • Gets a form button object

Source:
Parameters:
Name Type Description
name string
Returns:
Type
akioma.swat.Button

getComboBox(name) → {ComboBox}

Description:
  • Gets a form field combobox object

Source:
Parameters:
Name Type Description
name string

The form field name (case-insensitive)

Returns:
Type
ComboBox

getDataValue(name) → {*}

Description:
  • Helper method for getting a form field linked datasource value. Equivalent to form.dataSource.getValue('myfield').

Source:
Parameters:
Name Type Description
name string

The form field name (case-insensitive)

Returns:
Type
*

getDynSelect(name) → {DynSelect}

Description:
  • Gets a form field dynselect object

Source:
Parameters:
Name Type Description
name string

The form field name (case-insensitive)

Returns:
Type
DynSelect

getField(name) → {DataField}

Description:
  • Gets a form field object

Source:
Parameters:
Name Type Description
name string

The form field name (case-insensitive)

Returns:
Type
DataField

getFieldSet(name) → {FieldSet}

Description:
  • Gets a form field set object

Source:
Parameters:
Name Type Description
name string

The fieldset object name (case-insensitive)

Returns:
Type
FieldSet

getFormData() → {object}

Description:
  • Returns an object containing the form data

Source:
Returns:
Type
object

getFormFieldEnabled(name) → {boolean}

Description:
  • Method for returning the enabled state of a form field

Source:
Parameters:
Name Type Description
name string
Returns:
Type
boolean

getHTMLContent(name) → {akioma.swat.HTMLContent}

Description:
  • Gets a form HTML content object

Source:
Parameters:
Name Type Description
name string
Returns:
Type
akioma.swat.HTMLContent

getLabel(name) → {string}

Description:
  • Helper method for getting a form field label. Equivalent to form.getField('myfield').label.

Source:
Parameters:
Name Type Description
name string

The form field name (case-insensitive)

Returns:

value The value to set

Type
string
Description:
  • Gets the object's link source or target object

Source:
Inherited From:
Example
myForm.getLink("DISPLAY:SRC")
Parameters:
Name Type Description
link string

The link name separated by ":" and SRC/TRG points e.g. "DATA:TRG"

Returns:
Type
SwatObject
Description:
  • Gets the object's link source or target objects

Source:
Inherited From:
Example
myDataSource.getLinks("DISPLAY:TRG")
Parameters:
Name Type Description
link string

The link name separated by ":" and SRC/TRG points e.g. "DATA:TRG"

Returns:

[]

Type
SwatObject

getObject(name) → {SwatObject}

Description:
  • Gets a descendant object by name

Source:
Inherited From:
Parameters:
Name Type Description
name string

The object name (case-insensitive)

Returns:
Type
SwatObject

getRichText(name) → {RichText}

Description:
  • Gets a form field richtext object

Source:
Parameters:
Name Type Description
name string

The form field name (case-insensitive)

Returns:
Type
RichText

getScreenValue(name) → {*}

Description:
  • Helper method for getting a form field screen value. Equivalent to form.getField('myfield').screenValue.

Source:
Parameters:
Name Type Description
name string

The form field name (case-insensitive)

Returns:
Type
*

getToggle(name) → {Toggle}

Description:
  • Gets a form field toggle object

Source:
Parameters:
Name Type Description
name string

The form field name (case-insensitive)

Returns:
Type
Toggle

hasChanges() → {boolean}

Description:
  • Returns if there are changes in the object or its descendents

Source:
Inherited From:
Example
Object.hasChanges()
Returns:
Type
boolean

hasErrors() → {boolean}

Description:
  • Returns if there are changes in the object or its descendents

Source:
Inherited From:
Returns:
Type
boolean

removePanelMessage(id) → {void}

Description:
  • Remove a panel message from a controller by the given id

Source:
Inherited From:
Parameters:
Name Type Description
id number
Returns:
Type
void

save() → {Promise.<void>}

Description:
  • Saves values to the linked datasource. The form is first validated. If the validation fails the save is aborted.

Source:
Returns:
Type
Promise.<void>

saveAndClose() → {Promise.<void>}

Description:
  • Saves values to the linked datasource and closes the top-level window. The form is first validated. If the validation fails the save is aborted. Note that if the container is the main dekstop window, the window will not be closed.

Source:
Returns:
Type
Promise.<void>

setAllFieldsReadOnly(readonly)

Description:
  • Helper method to set all the form fields readonly property. Equivalent to looping through all the field names, getting the fields and setting readonly property.

Source:
Parameters:
Name Type Description
readonly boolean

setCustomState(name, optionsopt) → {void}

Description:
  • Set a custom state on a controller

Source:
Inherited From:
Parameters:
Name Type Attributes Description
name string
options object <optional>
Returns:
Type
void

setDataValue(name, value)

Description:
  • Helper method for setting a form field linked datasource value. Equivalent to form.dataSource.setValue('myfield', 'value').

Source:
Parameters:
Name Type Description
name string

The form field name (case-insensitive)

value *

The value to set

setFieldFocus(name)

Description:
  • Method for setting the focus on a certain form field

Source:
Parameters:
Name Type Description
name string

The form field name

setLabel(name, value)

Description:
  • Helper method for setting a form field label. Equivalent to form.getField('myfield').label = 'value'.

Source:
Parameters:
Name Type Description
name string

The form field name (case-insensitive)

value *

The value to set

setScreenValue(name, value)

Description:
  • Helper method for setting a form field screen value. Equivalent to form.getField('myfield').screenValue = 'value'.

Source:
Parameters:
Name Type Description
name string

The form field name (case-insensitive)

value *

The value to set

validate(silentopt) → {boolean}

Description:
  • Validates the form and highlights invalid form fields

Source:
Parameters:
Name Type Attributes Default Description
silent boolean <optional>
false

If the validation fails and not silent, forces form to be shown even if the form is in a collapsed panel or unselected tabbar etc.

Returns:
Type
boolean

validateField(name)

Description:
  • Method for validating form field by name

Source:
Parameters:
Name Type Description
name

Name of form field to validate