UI Component Field events - Platform - BlueCat Gateway - 24.1

Gateway Administration Guide

Locale
English
Product name
BlueCat Gateway
Version
24.1
Note: Currently, these events apply only to UI elements from the legacy Gateway UI. They currently do not apply to the updated UI introduced in BlueCat Gateway v23.2.

There are three main events used by UI Component Fields:

  • on_complete: The field is populated and valid and you want the user to move on to the next phase.

  • on_change: If the field input was modified.

  • on_click: (Buttons) Only if the button is clicked.

Use on_complete and enter a list of function names to be called on completion. For UI Component Fields you can use the format call_<name of another field component> to trigger their default JavaScript.

It is possible to control the behaviour of other fields based on event triggers. The parameters listed below defines the behaviour, and accepts a dictionary as input with the key being the event to trigger the behaviour and the value being a list of fields to perform the behaviour on. There are currently three behaviours:

  • enable_dependencies: Enables all specified fields when the event is triggered.

  • disable_dependencies: Disables all specified fields when the event is triggered.

    If should_cascade_disable_on_change is also True, BlueCat Gateway also disables dependents of the field

  • clear_dependencies: Clears all specified fields when the event is triggered. How this behavior works depends on the field being cleared. For example, with SelectFields it will clears all options on top of user input.

    If should_cascade_clear_on_change is also True, BlueCat Gateway also clears dependents of the field

Each UI Component Field will always generate call_<field id> and populate_<field id>

  • call_<field id> is responsible for field initialization

  • populate_<field id> is responsible for UI population from server retrieved data.

If you want to perform additional server-side calls (for example, to retrieve more data after validation and populate other fields) you can use the following parameters:

  • server_side_output_method: The server_endpoint to be called

  • server_output: Use to specify which event triggers the server_side_output_method and to map data properties returned by server with UI HTML element names, using the format:

    { <data property> : <html element id>, ...}
  • validators: Default WTForm validators. This is triggered to validate on form submit from the server-side.