Passing values between components or pages of the application
Platform Eximee Designer allows passing values from one component to another. Depending on whether the components are in the same artifact or in two different ones, value passing is done in different ways. We will also act differently when we only want to pass a value, and differently when we want to use the passed value, e.g. by making visibility depend on it.
Passing values between components located in the same artifact
If there is a need to copy a value from one Text Field (TextField) to another or to another component, e.g. to the content of a statement or from a value selection field (Combobox) displaying a list of identity document types to another Combobox, you can in the component to which we want to pass the value:
Use a script EchoServiceScript (choose in the section Interactions in the field EXTERNAL DATA SOURCE option Select a service and indicate this script), where you need to specify the transmitting component as input. In the script output parameters, the script output must be mapped appropriately to the component attribute. This approach additionally gives us the ability to specify a formatter that will appropriately modify the data received from the script.

Figure 1. Example of attached "EchoServiceScript" script Select in the field DATA SOURCE FROM ANOTHER FIELD data-transmitting component:

Select in the field DATA SOURCE FROM ANOTHER FIELD a session variable for which a service has been defined to pass a value from another component:

Figure 3. Setting the session variable from which values will be passed Select in the field EXTERNAL DATA SOURCE a service previously defined on the page (with input from the component passing the data):

Figure 4. Attaching "PageService"

Applying the above instruction to the value selection field/Date (and other components that pass a value, not the displayed content, label or description) would result in passing the value of that component. To pass the text (description or label), you need to:
if we want to pass the content (label or description) through DATA SOURCE FROM ANOTHER FIELD, instead of selecting the data-transmitting component there enter:
for the value selection field (Combobox) add after its id $label, e.g. GesCombobox1$label:

Figure 6. Passing text from the value selection field (Combobox) component for Date (DatePicker) add after its id $displayValue, e.g. GesDatePicker1$displayValue
if we want to use the content (label or description) in the content of another component (e.g. in the section title, add it to content or label), refer to this value selection field/Date as follows:
for the value selection field, provide the component id in curly braces preceded by a dollar sign with appended $label, e.g. ${GesCombobox1$label}:

Figure 7. Example of using text from the value selection field in a section title
for Date provide the component id in curly braces preceded by a dollar sign with appended $displayValue, e.g. ${GesDatePicker1$displayValue}.
Passing values between components located in different artifacts
In a situation where the components are not in one artifact (the same composite component), the values need to be injected into the target artifact. It does not matter whether both composite components are located on the same application form page.
Passing values takes place in two stages. First, in the component that will receive the values, input parameters must be defined, and then in the parent artifact the appropriate data-transmitting components must be mapped. The first stage can proceed in different ways, and its complexity depends on whether we only want to pass a value from component to component, or additionally want to make another action depend on that value, e.g. component visibility.
The general definition describing passing values to composite components can be found here: Input parameters of a composite component. However, special cases of value passing are not described there.
Direct value passing
If we want to use the passed data directly, i.e. only pass a value from one component to another (e.g. create a summary of data entered in the application), then in the composite component receiving values we need to define input parameters, i.e. indicate the components to which we will pass the value. To do this, in the left panel select the option Input parameters, and then Add input parameter. In the column Request component select the form field or session variable to which we want to pass the value:

After defining the input fields, save the composite component and open the artifact in which this component is embedded.
The next step is to map the values to the appropriate input fields, which should be done in the parent artifact relative to both composite components (the one transmitting and the one receiving the values). After selecting the artifact receiving the values, in that component's properties click the option INPUT PARAMETERS and in the drawer that slides out set the sources of the values to be retrieved.

Passing the value to a session variable and further use of the passed value
In a situation where we want another action to depend on the value passed to a component, e.g. component visibility, requiredness, or displaying the value of the value selection field in a label, the injected value should be passed to a session variable (instead of directly to the component).
The first stage, consisting of indicating the elements to which the values will be passed, should be started by creating session variables. To do this, in the left panel select the option Session variables and click the Add session variable. button. In the slide-out panel, in the empty row created at the very top, set the session variable name (detailed instructions here: Managing session variables). After creating the session variables, define value passing for them, which is done exactly like for components (in the panel Input parameters indicate each session variable to which we want to pass the value).
Stage two, i.e. mapping the values to the appropriate input fields in the parent artifact, is done exactly like for components (after selecting the artifact receiving the values, click the option in that component's properties INPUT PARAMETERS and in the drawer that slides out set the sources of the values to be retrieved).
Examples of using the value passed to a session variable are described in Managing session variables and below.
Various examples of value passing
Populating a label (Text component) directly from another field
in the artifact to which we want to pass the value for the label, define this label as an input field (in the panel Input parameters),
in the parent artifact map the appropriate component that is to pass data to the label (property INPUT PARAMETERS of the composite component).
Populating a label from several session variables
in the artifact to which we want to pass the value, create session variables and set them as input fields (in the panel Input parameters),
in the label we want to populate, in the property Content enter the variable names in the dollar-sign{variable_name} pattern (i.e. ${imie}); any content can be added before or after the reference to the session variable, e.g. Mrs. ${imie},
in the label we want to populate, add listening for the used variables (section Interactions, button List in subsection Listeners),
in the parent artifact map the appropriate components that are to pass value to the created session variables (property INPUT PARAMETERS).

Figure 10. Example of using session variables (first name and last name) in the "Label" component to pass a value
Populating a label with a "value selection field" (Combobox) value
Populating a label directly with a value from the value selection field would result in displaying the key of the selected value, therefore it is necessary to apply the following instruction:
in the artifact to which we want to pass the value for the label, define this label as an input field (in the panel Input parameters)
in the parent artifact map the appropriate Combobox that is to pass data to the label (property INPUT PARAMETERS of the composite component)
in the parent artifact's xml source, add $label after the id of the Combobox transmitting the value, i.e. if mapping has been set to Combobox1, then in the notation <data:InputMapping componentId="GesComplexComponent1.GesCombobox1" alias="typDokumentuTozsamosci"/>) after the id enter $label (here "GesComplexComponent1.GesCombobox1$label")
Populating a label with a value from the Data component (DatePicker), Radio Group and others
Populating a label directly from Date will result in displaying the selected date value as a timestamp, therefore the following instruction is necessary:
in the artifact to which we want to pass the value for the label, define this label as an input field (in the panel Input parameters),
in the parent artifact map the appropriate date component that is to pass data to the label (property INPUT PARAMETERS of the composite component),
in the parent artifact's xml source, in the row responsible for mapping to the Data component, add after the component id $displayValue.
The above instruction also applies to Radio Group, Product Choice and other components that pass a value, not the displayed content, label or description. In the described way, the value can be passed to a label, but also to a Text Field component or Formatted Content (TextContent).
Populating a session variable in another component with a value from a "value selection field" (Combobox)
If there is a need to populate a session variable or several components with a value from a value selection field located in another artifact, the value itself should be passed to that variable, not its key. To do this, it is worth creating a technical field, to which in the field DATA SOURCE FROM ANOTHER FIELD we add $label. In this way, the technical field already has the value of the Combobox and we can map this value to any artifact.
See also: Input parameters of a composite component.
Last updated
Was this helpful?
