Set the Binding Type for Variables in Dynamic Components

When a variable is used as an input parameter in a dynamic component in a fragment, you can assign a subtype to the variable to indicate how the input parameter is to be used.

Subtypes are typically used to configure how variables are displayed in the Properties pane, but there are some special subtypes that are used to set the binding type for variables in fragments, and do not affect how the variables are displayed in the Properties pane.

Specifying a binding type provides information that VB Studio requires to generate suitable metadata and expressions. The subtype you select should be based on the type of component where the variable is used. For example, if the variable will be used in a Dynamic Form Template, you would set the subtype to Dynamic Field.

To assign a subtype to a fragment variable:
  1. Open the fragment's Variables editor.
  2. Select the variable or constant.
  3. Open the Design Time tab in the Properties pane.
  4. Select the subtype for the fragment variable. Here are the subtypes that are used to set a binding type for a variable:
    Subtype valueOptions Usage
    Dynamic Field  

    Use Dynamic Field if the parameter will be bound to a Dynamic Field Binding (oj-dynamic-bind-field) component (which renders fields inside a Dynamic Form Template). In this case, the appropriate expression will be generated when a field is added to the fragment parameter, for example, value="[[ $fields.EmployeeName.name ]]".

    Dynamic Field Array none

    Use Dynamic Field Array if the parameter will be bound to a For Each (oj-bind-for-each) component where its template contains a Dynamic Field Binding (oj-dynamic-bind-field) component. In this case, the appropriate expression will be generated when fields are added to the fragment parameter, for example, value="[[ [$fields.FirstName.name, $fields.LastName.name] ]]". Using the template, the For Each binding duplicates markup sections for each field in the array and binds each field to the corresponding oj-dynamic-bind-field in the markup section. '

    Dynamic Container section

    Use Dynamic Container if the parameter will be bound to a Dynamic Container (oj-dynamic-container) component that will be configured differently on the pages it is used (meaning, to show some sections on one page and another set of sections on another page). In this case, the dynamic container rule set is generated so as to wire up the component correctly when the fragment is dropped onto a page or template.

    Dynamic Layout Context none

    The Dynamic Layout Context option is typically not something you'd set manually. When you plan to use a fragment within a Dynamic Form's or Dynamic Table's field or form template and you tag it as formTemplate or fieldTemplate in the Settings editor, a new variable called dynamicLayoutContext is created automatically and marked as a required input parameter with its binding type set to this option. Because dynamicLayoutContext is an umbrella variable which contains all other layout-related context variables such as $value, $metadata, and so on, you'd be able to drop the fragment on a field or form template and gain access to the parent dynamic layout context through this variable.