Event types, conditions, debounce, and handler configuration in V2 forms
V2 data forms provide a declarative event system that connects component interactions to actions. Instead of writing Vue event listeners in code, you declare handlers in the events object on any UINode. The renderer wires up the handlers at render time and routes events through the appropriate action type.This guide covers all five event types, condition expressions, debounce, attaching multiple handlers to a single event, and practical examples for each type. For the bridge methods available to script handlers, see the Bridge API reference.The event system is designed to keep form definitions self-contained. All behavior is declared in JSON alongside the component tree, making forms portable and auditable without reading source code.
Events are declared in the events object on a UINode. Each key is an event name (matching what the component emits), and the value is either a single EventConfig or an array of EventConfig objects.
The emitted event can carry a payload. The original event data from the component is passed through as the payload.Common uses: Communicating selections, actions, or state changes to the host application.
Store actions are not yet implemented in the current release. This event type is included for forward compatibility. Use script with kodexa.data bridge methods for data mutations in the meantime.
Every EventConfig can include a condition expression. The handler only executes when the condition evaluates to a truthy value. The condition has access to the same context as binding expressions.
The debounce field delays handler execution. Each new trigger resets the timer. This is useful for handlers attached to high-frequency events like input or change on text fields.
With a 300ms debounce, the handler waits 300ms after the last keystroke before executing. If the user types another character within that window, the timer resets.
Script modules (scriptModules) can also declare a default debounce value. When both the module and the event config specify a debounce, the event config value takes precedence.
Pass an array of EventConfig objects to attach multiple handlers to a single event. Handlers execute in order, and each one’s condition is evaluated independently.