DynSelect

DynSelect

new DynSelect()

Description:
  • DynSelect Object

Source:

Extends

Members

(readonly) attributes

Description:
  • Returns the object attributes

Source:
Inherited From:

Returns the object attributes

(readonly) changed :boolean

Description:
  • Returns true if the field value has been changed

Source:
Inherited From:

Returns true if the field value has been changed

Type:
  • boolean
Example
Field.changed

(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);

currentValue

Description:
  • For use in the valuechanged event. The current value. type {*}

Source:
Inherited From:

For use in the valuechanged event. The current value. type {*}

currentValueNative

Description:
  • For use in the valuechanged event. The current value native. type {*}

Source:
Inherited From:

For use in the valuechanged event. The current value native. type {*}

(readonly) dataSource :DataSource

Description:
  • The form field linked datasource

Source:
Inherited From:

The form field linked datasource

Type:

dataValue :*

Description:
  • The linked datasource field value

Source:
Inherited From:

The linked datasource field value

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);

enableLiveValidation

Description:
  • Whether the validation should be called on value set, screenValue

Source:
Inherited From:

Whether the validation should be called on value set, screenValue

ignoreValidateEvent :boolean

Description:
  • Returns whether should ignore validation event or not.

Source:
Inherited From:

Returns whether should ignore validation event or not.

Type:
  • boolean

keyName :*

Description:
  • The dynselect key field name

Source:

The dynselect key field name

Type:
  • *

keyValue :*

Description:
  • The dynselect field key value

Source:

The dynselect field key value

Type:
  • *

lastValue

Description:
  • For use in the valuechanged event. The last value. type {*}

Source:
Inherited From:

For use in the valuechanged event. The last value. type {*}

(readonly) lookupDataSource :DataSource

Description:
  • The lookup datasource for this dynselect field

Source:

The lookup datasource for this dynselect field

Type:

(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 :boolean

Description:
  • The dynselect field readonly mode

Source:

The dynselect field readonly mode

Type:
  • boolean

required :boolean

Description:
  • The form field required mode

Source:
Inherited From:

The form field required mode

Type:
  • boolean

(readonly) screen

Description:
  • The swat object inner screen (container)

Source:
Inherited From:

The swat object inner screen (container)

screenValue :*

Description:
  • The dynselect field screen value. Note that screenValue can only be updated with null, undefined or "" to clear the dynSelect and its keyValue.

Source:
Overrides:

The dynselect field screen value. Note that screenValue can only be updated with null, undefined or "" to clear the dynSelect and its keyValue.

Type:
  • *

screenValue :*

Description:
  • Set the dynselect field screen value.

Source:
Overrides:

Set the dynselect field screen value.

Type:
  • *

(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

typedValue

Description:
  • Get the typed text inside the dynselect.

Source:

Get the typed text inside the dynselect.

(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

addFilter(name, operator, value, unique)

Description:
  • Helper method for adding a filter to the lookup datasource filter (top level AND filter). Equivalent to dynSelect.lookupDataSource.addFilter().

Source:
Parameters:
Name Type Description
name

The field name

operator

The filter operator

value

The filter value

unique

If true, adds a new unique condition that will overwrite any conditions with the same field name. If false, just adds a new condition

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

clearFilter()

Description:
  • Helper method for clearing the lookup datasource filter. Equivalent to dynSelect.lookupDataSource.clearFilter().

Source:

clearHasChanges()

Description:
  • Method to clear the hasChanges flag on the object

Source:
Inherited From:
Example
Object.clearChanges()

clearPanelMessages() → {void}

Description:
  • Remove all panel messages from a controller

Source:
Inherited From:
Returns:
Type
void

clearSelect()

Description:
  • Clears the dynselect field screen value. Note that the dynselect datasource key value is synchronized with the screen value so clearing the screen will set the datasource key value to null

Source:

clearSelectLookupControls()

Description:
  • Method to clear the select lookup controls

Source:

clearSort()

Description:
  • Helper method to clear the lookup datasource sorting. Equivalent to dynSelect.lookupDataSource.clearSort().

Source:

decrementChanges() → {void}

Description:
  • Decrement has changes on a form with 1

Source:
Inherited From:
Returns:
Type
void

deleteValidationRule(rule)

Description:
  • Delete form field validation rule

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

The rule type i.e. 'required', 'minlength', 'maxlength' or 'notequal'

disablePreSelectExistingInput()

Description:
  • Method to disabling preSelectExistingInput option

Source:

enablePreSelectExistingInput()

Description:
  • Method to enabling preSelectExistingInput option

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:

getFieldValue(name) → {*}

Description:
  • Helper method for getting a field value in the lookup datasource. Equivalent to dynSelect.lookupDataSource.getValue("myfield").

Source:
Parameters:
Name Type Description
name string

The form field name (case-insensitive)

Returns:
Type
*
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

getSelectedRecord() → {Object}

Description:
  • Gets BusinessEntity data for selected record in dynSelect or the record selected from chooseWindow.

Source:
Returns:

Returns record data

Type
Object

getSort()

Description:
  • Helper method to get the lookup datasource current sorting. Equivalent to dynSelect.lookupDataSource.getSort().

Source:

getValidationRule() → {*}

Description:
  • Returns the form field validation type rule

Source:
Inherited From:
Returns:

The validation rule

Type
*

getValidationRules() → {*}

Description:
  • Returns all the form field validation rules

Source:
Inherited From:
Returns:

The validation rules

Type
*

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

hasFilter(name, operator, value) → {boolean}

Description:
  • Helper method to check if a filter exists in the lookup datasource (top level AND filter). Equivalent to dynSelect.lookupDataSource.hasFilter().

Source:
Parameters:
Name Type Description
name

The field name

operator

The filter operator

value

The filter value

Returns:
Type
boolean

hasSort(name, direction)

Description:
  • Helper method that returns if a field (and optional direction) are in the lookup datasource sorting. Equivalent to dynSelect.lookupDataSource.hasSort().

Source:
Parameters:
Name Type Description
name

The field name (case-insensitive). If no field name is passed, checks if there is any sorting.

direction

"asc" for ascending or "desc" for descending. If no direction is passed, check if only field name exists.

positionToRecord()

Description:
  • Method to positioning to a certain record

Source:

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

removeSelection(values)

Description:
  • Removes values from a multiple dynSelect.

Source:
Parameters:
Name Type Description
values string | Array.<string>

The values to remove from the dynSelect (case-insensitive)

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

setFieldValue(name, value)

Description:
  • Helper method for setting a field value in the lookup datasource. Equivalent to dynSelect.lookupDataSource.setValue("myfield", "value").

Source:
Parameters:
Name Type Description
name string

The form field name (case-insensitive)

value *

The value to set

setKeyValue(value)

Description:
  • Async set key value. Sets the key value and returns a promise that resolves when the key value is set. This method is used for positioning a dynselect on an exact result (or multiple results). The outcome is the same as selecting a result in the dropdown list automatically.

Source:
Example
async function foo(eventSource: akioma.swat.DynSelect) {
  await eventSource.setKeyValue('S');
  console.log(eventSource.keyValue);
}
Parameters:
Name Type Description
value any

If String or number, it represents the KeyValue value used for filtering using a FetchByUniqueKey NamedQuery.
If Array of Objects, it represents the new data that will be set in dynSelect

setNamedQueryParam(query, name, value, type)

Description:
  • Helper method to set the lookup datasource named query parameter. Equivalent to dynSelect.lookupDataSource.setNamedQueryParam()

Source:
Parameters:
Name Type Description
query string

The parameter query name

name string

The parameter field name

value *

The parameter value

type string

The parameter type

setSort(sortopt)

Description:
  • Helper method to sets the sorting in the lookup datasource. Equivalent to dynSelect.lookupDataSource.setSort().

Source:
Parameters:
Name Type Attributes Description
sort array <optional>
Properties
Name Type Description
field string

The field name

direction string

"asc" for ascending or "desc" for descending

setValidationRule()

Description:
  • Set form field validation rule (new or existing)

Source:
Inherited From:
Parameters:
Name Type Description
opts.rule string

The rule type i.e. 'required', 'minlength', 'maxlength' or 'notequal'

opts.smartmessage string

The smartmessage - e.g. 'valmsg-121'

opts.value *

The validation value