JavaScript

{dialog.object}formViewSetStateVariables Method

Syntax

{dialog.object}.formViewSetStateVariables(UXFormViewControlId, stateVariablesJSON);

Arguments

UXFormViewControlIdstring

The FormView control's ID.

stateVariablesJSONJSON

A JSON object definition with name-value pairs for each of the variables to set in the state object.

Description

Sets FormView state variables.

Discussion

The formViewSetStateVariables method can be used to set variables in a FormView control's state object. State variables can be referenced in the FormView Layout template. For example, you may want to reference a state variable in a client-side show/hide or enable expression. To reference a state variable in a client-side expression, use this syntax:

[temp].state.variables.your_variable_name

To set state variables, pass in a JSON object of name-value pairs. For example:

var _s = {myVar1: 'value 1', myVar2: 'value 2'};
{dialog.object}.formViewSetStateVariables('FORM_1',_s);