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 proceed differently if we only want to pass a value, and differently if we want to use the passed value, e.g. to condition visibility.
Passing values between components located in the same artifact
If it's necessary to copy a value from one Text Field (TextField) to another or to another component, e.g. into the content of a statement or from a Combobox displaying a list of identity document types to another Combobox, you can in the component to which you want to pass the value:
Use a script EchoServiceScript (select in the Interactions in the field EXTERNAL DATA SOURCE window the Select service section and point to that script), in which you should provide the component that supplies the data as input. In the script's output parameters you should appropriately map the script output to the component attribute. This approach also gives us the possibility to specify a formatter that will appropriately modify the data received from the script.

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

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

Illustration 3. Setting the session variable from which values will be passed
Select in the field EXTERNAL DATA SOURCE a service defined earlier on the page (having an input from the component that supplies the data):

Illustration 4. Attaching "PageService"

Applying the above instruction for a Combobox/Date (and other components that pass a value, not the presented content, label or description) would result in passing the value of that component. To pass the text (description or label), you should:
if the content (label or description) we want to pass via DATA SOURCE FROM ANOTHER FIELD, instead of selecting the component that supplies data there enter:
for a Combobox (Combobox) append to its id $label, e.g. GesCombobox1$label:

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

Illustration 7. Example of using text from a Combobox in a section title
for a Date provide the component id in curly braces preceded by a dollar with appended $displayValue, e.g. ${GesDatePicker1$displayValue}.
Passing values between components located in different artifacts
If components are not located in a single artifact (the same complex component), values must be injected into the fed artifact. It does not matter whether both complex components are on the same application page.
Value passing proceeds in two stages. First you should define input parameters in the component that will receive values, and then in the parent artifact map the appropriate components that supply data. The first stage can vary and its complexity depends on whether we only want to pass a value from component to component, or additionally want to depend another action on that value, e.g. component visibility.
A general definition describing passing values to complex components is located here: Input parameters of the composite component. However, special situations of value passing are not described there.
Direct value passing
If the data being passed will be used directly, i.e. only to pass a value from one component to another (e.g. to create a summary of the data entered in the application), then in the complex component receiving values you should define input parameters, i.e. indicate the components to which we will pass the value. To do this, select the option in the left panel Input parameters, and then Add input parameter. In the Application component column select the field from the application or the session variable to which you want to pass the value:

After defining the input fields you should save the complex component and open the artifact in which this component was 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 complex components (the one passing and the one receiving values). After selecting the artifact receiving values, in the properties of that component click the option INPUT PARAMETERS and in the drawer that opens determine the sources of the retrieved values.

Passing a value to a session variable and further use of the passed value
If you want to use the value injected into the component to condition another action, e.g. component visibility, requiredness, or display the value of a Combobox in a label, the injected value should be passed to a session variable (instead of directly to the component).
The first stage, which involves indicating the elements that will receive values, should start by creating session variables. To do this, select the option in the left panel Session variables and click the button Add session variable. In the panel that slides out, in the empty row created at the very top set the name of the session variable (detailed instructions here: Manage session variables). After creating the session variables you should define the value passing for them, which is done identically as for components (in the Input parameters panel indicate each session variable to which you want to pass a value).
The second stage, i.e. mapping values to the appropriate input fields in the parent artifact, proceeds identically as for components (after selecting the artifact receiving values, in the properties of that component click the option INPUT PARAMETERS and in the drawer that opens determine the sources of the retrieved values).
Examples of using values passed to a session variable are described in Manage session variables and below.
Various examples of passing values
Feeding a label (Text component) directly from another field
in the artifact to which you want to pass the value define that label as an input field (in the Input parameters),
panel in the parent artifact map the appropriate component that should pass data to the label (the INPUT PARAMETERS property of the complex component).
Feeding a label from several session variables
in the artifact to which you want to pass the value create session variables and set them as input fields (in the Input parameters),
in the label you want to feed, in the property Content enter variable names in the dollar scheme {variable_name} (i.e. ${name}); you can add any content before or after referencing the session variable, e.g. Ms ${name},
in the label you want to feed add listening for the used variables (section Interactions, button List in the Listening),
in the parent artifact map the appropriate components that should pass values to the created session variables (the INPUT PARAMETERS).

Figure 10. Example of using session variables (first and last name) in the "Label" component to pass values
Feeding a label with the value of a Combobox
Feeding a label directly with the value from a Combobox would result in displaying the key of the selected value, therefore it is necessary to apply the following instruction:
in the artifact to which you want to pass the value define that label as an input field (in the Input parameters)
in the parent artifact map the appropriate Combobox that should pass data to the label (the INPUT PARAMETERS property of the complex component)
in the parent artifact's xml source add $label after the id of the Combobox that supplies the value, meaning if mapping was set to Combobox1, then in the record <data:InputMapping componentId="GesComplexComponent1.GesCombobox1" alias="typDokumentuTozsamosci"/>) for the id you should enter $label (here "GesComplexComponent1.GesCombobox1$label")
Feeding a label with a value from the Date component (DatePicker), Radio Group and others
Feeding a label directly from a Date will result in displaying the selected date value as a timestamp, therefore it is necessary to apply the following instruction:
in the artifact to which you want to pass the value define that label as an input field (in the Input parameters),
in the parent artifact map the appropriate date component that should pass data to the label (the INPUT PARAMETERS property of the complex component),
in the parent artifact's xml source in the row responsible for mapping to the Date component append to the component id $displayValue.
The above instruction also applies to Radio group, Product selection and other components that pass a value, not the presented content, label or description. In the way described the value can be passed to a label, but also to a Text Field or Formatted Content (TextContent) component.
Feeding a session variable on another component with the value of a Combobox
If it is necessary to feed a session variable or several components with the value of a Combobox located in another artifact, you should pass to that variable the value itself, not its key. For this purpose 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 Combobox value and we can map this value to any artifact.
See also: Input parameters of the composite component.
Last updated
Was this helpful?
