Wiring a service at the page or whole application level

Example of connecting a service

Besides the standard attachment of services to individual components, Eximee allows defining services at the page or application level. They are used to supply data to multiple fields at once or to perform operations when entering/exiting an application. For example, you can define a PageService for a page with the client's address that, after entering the postal code, will automatically fetch and fill in the city and voivodeship in other fields. Another case is an EntryService triggered when opening the application – e.g., fetching basic client data and populating the form with it.

Step-by-step configuration:

  1. Adding a service at the form level: First, you need to register the appropriate service in the context of the application:

    • Page service (PageService): To add a page service, open the Page services tab located on the left side of the editor view.

    • Entry/exit application service (Entry/Exit Service): In the Properties tab of the entire application, you should add the service as an Entry service (executed when opening the application) or an Exit service (executed when finishing or submitting the application).

      Figure 1. Service selection window defined for the page (filtered list to PageService available on the application)
  2. Connecting the service to a component: Next, select the component that should display data coming from the selected service (e.g., the Client City field). In its properties, in the Interactionssection, you need to use the External data source field again – click Select service and search the list for the previously created service. Then choose the appropriate Page or Entry type service from the list.

    Figure 2. Output parameter selection window for the service
  3. Mapping results: After selecting the service, go to the Output parameterstab. From the data returned by the service, select the appropriate output field and map it to the component attribute. For example, the PobierzDaneKlientaService can be mapped so that the value attribute of the City field receives the value from the clientCity parameter returned by the service.

  4. Input parameters (if required): If a page/application-level service requires input parameters (e.g., postal code as input to PageService), these parameters should be linked in the EDS input configuration. By default, listening will be set on the components specified in the input parameters.

  5. Refreshing data on change: Thanks to the listening mechanism, if the value in the service's input field (e.g., postal code) changes, the associated Page/Entry service will be automatically invoked again and dependent components refreshed. The user does not need to take additional actions – the form will ensure the data is up to date.

Last updated

Was this helpful?