Overview

Callbacks + Events

Application hooks, lifecycle callbacks, and custom events between components.

Screenshot Reference (User Manual)

  • manual__callback__01.png: callback/events configuration in the metadata editor.

Table Metadata (Lifecycle Callback)

Description:

these metadata orchestrate the main hooks of the route's data lifecycle.

  • md_before_save: callback executed before sync (insert/update/delete), useful for validations and payload transformations.
  • md_after_save: post-sync callback, useful for UI notifications, dependent refresh, side effects.
  • md_after_load: callback after data loading, useful for runtime initializations and record post-processing.
  • md_conditional_update_rule: conditional rule that enables/blocks update on the current record.
  • md_conditional_delete_rule: conditional rule that enables/blocks delete on the current record.

Snippet (table example):

  • md_after_load = "utility.onAfterLoad"
  • md_before_save = "utility.beforeSaveGuard"
  • md_after_save = "utility.afterSaveNotify"
  • md_conditional_update_rule = "record.status !== 'LOCKED'"
  • md_conditional_delete_rule = "record.canDelete === true"

Column Metadata (Field-Level Events)

Description:

these metadata manage reactive behavior and point validation on individual fields.

  • mc_selection_changing_custom_function: hook before value change (pre-change).
  • mc_selection_changed_custom_function: hook after value change (post-change).
  • mc_default_value_callback: dynamic default value calculation.
  • mc_suggest_value_callback: callback for value suggestion/auto-population.
  • mc_validation_custom_callback: custom business validation on the field.
  • mc_logic_converter_read_callback: value conversion on read (rendering/model mapping).
  • mc_logic_converter_write_callback: value conversion on write (before save).
  • mc_value_change_trigger_event: UI event that triggers value change (keyup, change, etc.).

Snippet (column example):

  • mc_default_value_callback = "utility.defaultProvince"
  • mc_selection_changing_custom_function = "utility.beforeProvinceChange"
  • mc_selection_changed_custom_function = "utility.afterProvinceChange"
  • mc_validation_custom_callback = "utility.validateProvince"
  • mc_value_change_trigger_event = "change"

Typical Event Flow

1. Record loading: md_after_load.

2. User interactions on fields: mc_selection_changing_custom_function -> mc_selection_changed_custom_function.

3. Save: md_before_save.

4. Persistence completed: md_after_save.

Operational Notes

  • Keep callbacks idempotent and with explicit error handling.
  • Avoid heavy logic in high-frequency field callbacks (keyup).
  • Use table callbacks for general orchestration and column callbacks for point logic.

Result:

  • predictable behavior between load/edit/save;
  • clear separation between global rules (table) and local rules (column).

Screenshot

callbacks-events / main
callbacks-events / main