Skip to main content

Variables

To ensure our Scheda components are dynamic, the use of variables is essential. Variables enable customization and flexibility, allowing Scheda properties to adapt based on different data inputs and user interactions.

Our system supports two types of variables to enhance the dynamism of Scheda components:

  • Static Variables: These are defined using the syntax &. Static variables hold constant values that do not change at runtime.

  • Dynamic Variables: These are enclosed within square brackets [variable-name]. Dynamic variables are evaluated and updated in real-time based on user interactions or data changes.

Static Variables

Our system utilizes several key static variables to ensure consistent and reliable behavior across Scheda components. Here are the main static variables used:

  1. Object Variables
  • &OG.T1 (Type): Specifies the type of the object.
  • &OG.P1 (Parameter): Defines a specific parameter associated with the object.
  • &OG.K1 (Code): Represents the unique code identifier for the object.
  1. Environment Variables
  • &AM.DV (Device): Indicates the device type or identifier.
  • &AM.UT (User): Denotes the user associated with the current session or context.
  • &AM.LL (Environment): Specifies the environment context, such as development, staging, or production.
  1. Parameter And Input Variables
  • &PA.variable_name and &IN.variable_name: a function can pass variables through parameters or inputs.

    For example:

    INPUT(FIRST_NAME(John)) P(LAST_NAME(Doe))

    These variables can be referenced using the syntax:

    &IN.FIRST_NAME 
    &PA.LAST_NAME
  1. OAV Variables
  • &OA.OAV_code: this variable allows developers to retrieve the content of an entity based on its OAV codes.

Static Variables Scope

  • Environment Variables: hold values within the current session and are classified as environment variables.
  • Object Variables | Parameter And Input Variables | OAV Variables: are server-side and valid at the scheda level, enabling scoped data management for individual scheda.

Dynamic Variables

Dynamic variables are enclosed within square brackets [VAR]. These variables are dynamically assigned based on user selections and interactions with the scheda's components. They are generated after the initial rendering of the scheda, meaning their values cannot influence the construction or layout of the scheda itself.

warning

To ensure correct interpretation of dynamic variables, the first character of their name must not be a number.

Dynamic variables can be declared as needed at the beginning of a scheda, allowing them to be accessed globally within that scheda.

::S.VAR.VAL Sch.Var="<variable_name>(<variable_value>)"

Alternatively, a dynamic variable can be declared and assigned within a component's dynamic behavior, with its value populated after the behavior's execution.

::G.DIN When="Click" Sch.Var="<variable_name>(<variable_value>)"

Dynamic variables within a component can also utilize values obtained from FUN or from the ::D.OGG parameters, which are assigned after dynamism. These variables are referenced based on the corresponding column name using the syntax [<column_name>].

::G.SEZ Pos(1)
::G.SUB.MAT Tit="*NONE"
::G.DIN When="Click" Sch.Var="<variable_name>([<column_name>])"
::D.FUN.STD F(<fun_syntax>)

::G.SEZ Pos(2)
::G.SUB.BTN
::G.DIN When="Click" Exec="F(OPN;PATH;) 1(J1;URL;[K1])"
::D.OGG T(J1) P(URL) K(<link_example>) D(Read the Doc)

Dynamic Variables Scope

Dynamic variables are specific to the scheda in which they are created, meaning they can only be accessed and used within that particular scheda. When working with sub-scheda, any dynamic variables defined inside a sub-scheda are restricted to that sub-scheda alone and cannot be accessed from the parent scheda or other sub-scheda.