Module

Common_Functions_AllWidgets

Methods

# inner getContainerIndex() → {number}

Returns the index of the container of the widget. This may be the index of a column if the widget is in an array, or the index of a tab if the widget is in a tab panel.
number

# inner getElement() → {Object}

Returns the HTML object of a widget.
Object

# inner getLabel() → {string}

Returns the label of a widget (if it has one).
string

# inner getListOfMyVariables() → {Array.<string>}

Returns the list of variables of a widget.
Array.<string>

# inner getMissingVariableMessage() → {string}

Returns the message which is displayed when a mandatory widget variable is missing.
string

# inner getName() → {string}

Returns the ID of the widget as a string.
string

# inner getParent() → {object}

Returns the parent widget of a widget.
object

# inner getTooltip() → {string}

Returns the tooltip text of the widget.
string

# inner getValidationVariableMessage() → {string}

Returns the message which is displayed when a validation rule is not met.
string

# inner getValue() → {string}

Returns the value of a widget on the current web page (e.g. text input).
Value of the variable
string

# inner getVariableValue(varName) → {string}

Returns the value of a given variable of the widget.
Parameters:
Name Type Description
varName string Variable name
string

# inner insertAbove(newWidget)

Allows you to insert above widgetID, the new widget created thanks to new RMP_xxx() function.
Parameters:
Name Type Description
newWidget Object the new widget

# inner insertAfter(newWidget)

Allows you to insert on the left of widgetID, the new widget created thanks to new RMP_xxx() function.
Parameters:
Name Type Description
newWidget Object the new widget

# inner insertBefore(newWidget)

Allows you to insert on the right of widgetID, the new widget created thanks to new RMP_xxx() function.
Parameters:
Name Type Description
newWidget Object the new widget

# inner insertBelow(newWidget)

Allows you to insert bellow widgetID, the new widget created thanks to new RMP_xxx() function.
Parameters:
Name Type Description
newWidget Object the new widget

# inner isActive() → {boolean}

Returns true if the widget is active, otherwise false. Be aware that this method does not return the value of the Editable option as it was defined in the WebModeler, since this value can change at runtime with setActive.
boolean

# inner isEmptyVariable(varName) → {boolean}

Returns true if the given variable is empty, otherwise false.
Parameters:
Name Type Description
varName string Variable name
boolean

# inner isEnabled() → {boolean}

Returns true if the widget is active, otherwise false (same as isActive). Be aware that this method does not return the value of the Editable option as it was defined in the WebModeler, since this value can change at runtime with setEnabled.
boolean

# inner isIndexed() → {boolean}

Returns true if the widget variable is an array, otherwise false.
boolean

# inner isIndexedVariable(varName) → {boolean}

Returns true if the given variable is an array, otherwise false.
Parameters:
Name Type Description
varName string Variable name
boolean

# inner isRequired() → {boolean}

Returns true if the widget variable is required, otherwise false.
boolean

# inner isValid() → {boolean}

Returns true if the widget variable is valid, otherwise false.
boolean

# inner isValidVariable(varName) → {boolean}

Returns true if the given variable is valid, otherwise false.
Parameters:
Name Type Description
varName string Variable name
boolean

# inner isVisible() → {boolean}

Returns true if the widget is visible, otherwise false.
boolean

# inner moveAfter(insertedWidget)

Allows you to move inserted widget after (on the right) widgetID.
Parameters:
Name Type Description
insertedWidget Object the inserted widget

# inner moveBefore(insertedWidget)

Allows you to move inserted widget before (on the left) widgetID.
Parameters:
Name Type Description
insertedWidget Object the inserted widget

# inner remove(insertedWidget)

Allows you to remove insertedWidget.
Parameters:
Name Type Description
insertedWidget Object the inserted widget

# inner setActive(active)

Sets the widget as active (true) or inactive (false).
Parameters:
Name Type Description
active boolean true: active, false: inactive

# inner setActiveRule(condCallback, listenedVariablesopt, defaultValueopt)

Executes the condCallback script and sets the active state of the widget according to the execution result.
Parameters:
Name Type Attributes Default Description
condCallback module:Common_Functions_AllWidgets~callbackCondition Callback function which handles the active state condition
listenedVariables Array.<string> <optional>
[] Variables that should be replaced by their values inside the `condCallback` function
defaultValue boolean <optional>
true Default value of the widget's active state

# inner setEnabled(boolean)

Sets the widget as active (true) or inactive (false).
Parameters:
Name Type Description
boolean bool true: active, false: inactive

# inner setLabel(text)

Sets the label of a widget (except for HTML, image, array, and static text widgets which do not have a label field).
Parameters:
Name Type Description
text string Label

# inner setMissingVariableMessage(msg)

Sets the message which is displayed when a mandatory widget variable is missing.
Parameters:
Name Type Description
msg string Missing variable message

# inner setRequired(required)

Sets the mandatory status of the widget variable.
Parameters:
Name Type Description
required boolean true: required, false: optional

# inner setRequiredRule(condCallback, listenedVariablesopt, defaultValueopt)

Executes the condCallback script and sets the required state of the widget according to the execution result.
Parameters:
Name Type Attributes Default Description
condCallback module:Common_Functions_AllWidgets~callbackCondition Callback function that handles the required condition
listenedVariables Array.<string> <optional>
[] Variables that should be replaced by their values inside the `condCallback` function
defaultValue boolean <optional>
true Default value of the widget's required state

# inner setTooltip(tooltip)

Sets the tooltip text of a widget.
Parameters:
Name Type Description
tooltip string Tooltip text value

# inner setValidationVariableMessage(msg)

Sets the message which is displayed when a validation rule is not met.
Parameters:
Name Type Description
msg string Message to display

# inner setValideRule(condCallback, listenedVariablesopt, defaultValueopt)

Executes the condCallback script and sets the valid state of the widget according to the execution result.
Parameters:
Name Type Attributes Default Description
condCallback module:Common_Functions_AllWidgets~callbackCondition Callback function that handles the valid condition
listenedVariables Array.<string> <optional>
[] Variables that should be replaced by their values inside the `condCallback` function
defaultValue boolean <optional>
true Default value of the widget's valid state

# inner setValue(value)

Sets the value of the widget variable. This does not work for list widgets (list, check box list, radio button list), where you should use widgetID.setSelectedValue instead.
Parameters:
Name Type Description
value string Value to set

# inner setVariableValue(varName, value)

Sets the value of a given variable of the widget.
Parameters:
Name Type Description
varName string Variable name
value string Variable value

# inner setVisible(visible)

Sets the widget as visible (true) or invisible (false).
Parameters:
Name Type Description
visible boolean true: visible, false: invisible

# inner setVisibleRule(condCallback, listenedVariablesopt, defaultValueopt)

Executes the condCallback script and sets the visible state of the widget according to the execution result.
Parameters:
Name Type Attributes Default Description
condCallback module:Common_Functions_AllWidgets~callbackCondition Callback function that handles the visible state condition
listenedVariables Array.<string> <optional>
[] Variables that should be replaced by their values inside the `condCallback` function
defaultValue boolean <optional>
true Default value of the widget's visible state

Type Definitions

# callbackCondition() → {boolean}

Callback function to handle a rule condition of a widget (active, visible, valid, required).
true if the widget is visible/active/valid/required, otherwise false.
boolean