Skip to main content

Button Events

Button events are triggered when the user clicks a button. The event fired depends on the configured Button Type. The backend uses the widgetName and widgetEvent properties on the incoming request to identify the event and respond appropriately.


Event Summary​

Button TypeEvent SentBackend Event Required
SaveonSaveYes
CustomonClickYes
CancelonCancelYes
PrintonPrintYes
None(none)No

Event Details​

onSave​

Fired when the user clicks a Save button.

The form data is collected and sent to the backend. The backend should:

  1. Detect the event via widgetEvent === "onSave"
  2. Validate and persist the form data
  3. Return an appropriate response (e.g., close the form, navigate away, or show a confirmation message)

→ Request payload example


onClick​

Fired when the user clicks a Custom button.

Use this type for any backend-driven action that does not fit the built-in Save, Cancel, or Print behaviors. The backend should:

  1. Detect the event via widgetEvent === "onClick"
  2. Identify the specific button via widgetName
  3. Execute the required logic (e.g., trigger a workflow, open a modal, call an external API)
  4. Return an appropriate response
tip

If a form has multiple Custom buttons, each button should have a unique Name so the backend can distinguish which button was clicked using widgetName.

→ Request payload example


onCancel​

Fired when the user clicks a Cancel button.

The backend should:

  1. Detect the event via widgetEvent === "onCancel"
  2. Execute the required logic (e.g., discard changes, navigate away, close the form)
  3. Return an appropriate response

→ Request payload example


onPrint​

Fired when the user clicks a Print button.

The backend should:

  1. Detect the event via widgetEvent === "onPrint"
  2. Execute the required logic (e.g., prepare a print-ready version of the data, trigger a PDF export)
  3. Return an appropriate response

→ Request payload example