Form View Control Actions

Description

Perform some action on a Form View control.

Actions

The following actions can be performed using the Form View Control Actions action:

  • Set Form View field value

    Set the value of a field in the FormView control.

  • Refresh

    Reload the original data from the data source for the FormView.

  • Clear Errors

    Clear all errors in the FormView.

  • Commit

    Commits the data in the FormView to the FormView's data source.

  • Populate Form

    Populates the FormView with data.

  • New Record

    Displays a new record in the FormView.

  • Navigate

    Set focus to the 'first', 'last', 'next', or 'prev' field on the FormView. The associated Editor (if defined) will be opened.

  • Set Active Layout

    If the FormView defines multiple Layouts, selects the active Layout.

  • Set Active Tab Pane

    If the FormView Layout uses Tabs, set the active Pane in the Tab control.

  • Refresh value in Editor

    If a value in the FormView is currently being edited in an Editor, refreshes the value shown in the editor.

  • Set state variables

    Set FormView state variables. State variables can be referenced in the FormView template syntax [temp].variables.variableName

  • Get state variables

    Sets a variable to the FormView's state variables object.

Getting and Setting State Variables

State variables can be referenced in the FormView layout templates (and therefore in client-side show/hide and enable expressions) using this syntax:

[temp].state.your_variable_name

Say you had a container in a FormView layout that contained several controls. You wanted to show this container if a session variable (called say myVar1) was equal to 'alpha'.

Here is how you would do this:

Set the show/hide expression for the container to

[temp].state.myVar1 == 'alpha'

In the client-side onRenderComplete event, execute this code to set the FormView control's myVar1 state variable to the value of the session variable.

var myVar1 = {dialog.Object}.getSessionVariable('MYVAR1');
{dialog.object}.formViewSetStateVariables('FORMVIEW_1',{myVar1: myVar1});
In order to reference session variables in client side expressions, they must be published to the client. See UX Properties > Other > Published session variables.

To learn more, check out the video below, "Client-side Show/Hide and Enable Expressions that Reference External Data".

Form View Control Action Properties

Action name

Specify the Action that you want to execute.

Form View Control Id

Specify the Form View control you want to perform an action on.

Navigation direction

Navigation direction property. Choices include First, Last, Next, Prev.

Field to set

Field to set property.

Field value Javascript

Specify Javascript code to get the value that you want to set the Form View field to. Your code must 'return' the value. e.g. return 'Smith';

Form data Javascript

Specify Javascript code to get the data to populate the form. Your code must 'return' an object with properties for each field in the form.

Layout name

Specify the Layout name. (Case-sensitive)

Videos

Client-side Show/Hide and Enable Expressions that Reference External Data

Typically, the client-side show/hide and enable expressions in a FormView layout reference field values that are in the data being displayed in the Form. For example, the Form might have a field called Country and you might want to show a container only when the Country field has a certain value.

However, there are also use cases where you want to reference external data (i.e. the value in some other control on the UX) in a client-side expression. This video shows how this is done using FormView state variables.

Download Component

2017-08-14

Limitations

UX Component Only

See Also