Passing values between components or request pages

Platform Eximee Designer allows values to be passed 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 in a situation where we want only to pass a value, and differently when we want to use the passed value, e.g. by making visibility depend on it.

Passing a value 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 from a list (Combobox) displaying a list of identity document types to another Combobox, in the component to which we want to pass the value you can:

  • Use the script EchoServiceScript (choose in the Interactions section in the EXTERNAL DATA SOURCE field the Choose service option and point to that script), in which you need to provide the data-providing component as input. In the script output parameters, the script output should 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 the attached "EchoServiceScript" script
  • Select in the DATA SOURCE FROM ANOTHER FIELD field the data-providing component:

Figure 2. Setting the data source as the component from which the data will be retrieved
  • Select in the DATA SOURCE FROM ANOTHER FIELD a session variable for which a service has been defined that passes a value from another component:

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

    Figure 4. Attaching "PageService"
circle-info

In all cases, remember to listen on the component whose value you are copying (more in the topic: Listening and clearing).

Figure 5. Example of copying values from Text Fields to Labels (using "EchoService", "DATA SOURCE FROM ANOTHER FIELD" and a session variable)

Applying the above instructions to a Value Selection Field from a list/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 we want to pass the content (label or description) through DATA SOURCE FROM ANOTHER FIELD, instead of selecting the data-providing component there, enter:

    • for the Value Selection Field from a list (Combobox), append $label, e.g. GesCombobox1$label:

      Figure 6. Passing text from the Value Selection Field from a list (Combobox) component

    • for Date (DatePicker), append $displayValue, e.g. GesDatePicker1$displayValue

  • if we want to use the content (label or description) in the content of another component (e.g. in a section title, add it to the content or label), refer to this Value Selection Field from a list/Date as follows:

    • for the Value Selection Field from a list, provide the component ID in curly braces preceded by a dollar sign with $label, e.g. ${GesCombobox1$label}:

      Figure 7. Example of using text from the Value Selection Field from a list in a section title

  • for Date, provide the component ID in curly braces preceded by a dollar sign with $displayValue, e.g. ${GesDatePicker1$displayValue}.

circle-info

The list of component attributes available after "$" is described in: Component attributes.

Passing a value between components located in different artifacts

If the components are not in one artifact (the same composite component), values must be injected into the fed artifact. It does not matter whether both composite components are located on the same application page.

Passing values is a two-step process. First, in the component that will receive values, define the input parameters, and then in the parent artifact map the appropriate data-providing components. The first step may vary, and its complexity depends on whether we only want to pass a value from one component to another or whether we additionally want another action to depend on that value, e.g. component visibility.

The general definition describing passing values to composite components is available here: Composite component input parameters. However, special cases of value passing are not described there.

Passing values directly

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 the data entered in the application), then in the composite component receiving the 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 form field or session variable to which you want to pass the value:

Figure 8. Example of defined input parameters for components and session variables

After defining the input fields, save the composite 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 must be done in the parent artifact relative to both composite components (the one passing and the one receiving values). After selecting the artifact receiving values, click the INPUT PARAMETERS option in the properties of this component and set the sources of the retrieved values in the slide-out drawer.

circle-info

If after clicking the property INPUT PARAMETERS the list of parameters is not visible, refresh the console window.

Figure 9. Example of mapping parameters to components of the artifact passing values (e.g. GesComplexComponent1.GesTextField3) and session variables (e.g. imieNazwiskoPesel)

Passing a value to a session variable and further use of the passed value

If we want another action to depend on the value passed to a component, e.g. component visibility, requiredness, or displaying the value of a Value Selection Field from a list 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 values will be passed, should begin by creating session variables. To do this, select the option in the left panel Session variables and click the Add session variable. button. In the slide-out panel, in the empty row created at the 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 in the same way 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 the values to the appropriate input fields in the parent artifact, is carried out identically as for components (after selecting the artifact receiving values, click the INPUT PARAMETERS option in the properties of this component and set the sources of the retrieved values in the slide-out drawer).

Examples of using the value passed to a session variable are described in Managing session variables and below.

Various examples of passing values

Filling 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 Input parameters),

  • in the parent artifact, map the appropriate component that is to pass data to the label (the property of the INPUT PARAMETERS composite component).

Filling a label with 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 Input parameters),

  • in the label we want to populate, in the Content property enter the variable names using the dollar sign{name_of_variable} scheme (i.e. ${imie}); you can add any content before or after the reference to the session variable, e.g. Ms. ${imie},

  • in the label we want to populate, add listening to the used variables (section Interactions, button List in the Listening),

  • in the parent artifact map the appropriate components that are to pass the value to the created session variables (the property INPUT PARAMETERS).

    Figure 10. Example of using session variables (first name and last name) in the "Label" component to pass a value

Filling a label with the value of a "Value Selection Field from a list" (Combobox)

Filling a label directly with the value from a Value Selection Field from a list would result in displaying the key of the selected value, therefore it is necessary to use the instructions below:

  • in the artifact to which we want to pass the value for the label, define this label as an input field (in the Input parameters)

  • in the parent artifact, map the appropriate Combobox that is to pass data to the label (the property INPUT PARAMETERS of the composite component)

  • in the XML source of the parent artifact, add $label after the id of the Combobox passing the value, i.e. if mapping has been set to Combobox1, then in the record <data:InputMapping componentId="GesComplexComponent1.GesCombobox1" alias="typDokumentuTozsamosci"/>) after the id you should enter $label (here "GesComplexComponent1.GesCombobox1$label")

Filling a label with the value from a Date component (DatePicker), Radio Group and others

Filling a label directly from a Date will display the value of the selected date as a timestamp, therefore it is necessary to use the instructions below:

  • in the artifact to which we want to pass the value for the label, define this label as an input field (in the Input parameters),

  • in the parent artifact, map the appropriate date component that is to pass data to the label (the property INPUT PARAMETERS of the composite component),

  • in the XML source of the parent artifact, in the row responsible for mapping to the Date component, add after the component id $displayValue.

The above instructions also apply 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.

Filling a session variable in another component with the value of a "Value Selection Field from a list" (Combobox)

If there is a need to fill a session variable or several components with the value of a Value Selection Field from a list located in another artifact, then the value itself, not its key, should be passed to that variable. 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: Composite component input parameters.

circle-info

In one composite component, values can be passed directly to a component as well as to session variables. The method of passing depends on the further use of the injected values.

Last updated

Was this helpful?