on-press

Optional

Default: unset

Triggered when: Specific per component. Please see the table below.

Event parameter: Specific per component. Please see the table below.

Return value: Specific per component (based on field type). Please see the table below.

on-press is an event that calls a JS/TS $:function or navigation. See more details:

Note: The on-press function will call validation (as specified by the validate attribute) if set.

Component-specific details

Example:

main.view.xml
<button label="Submit" on-press="$:submitForm(current_form)"/>
main.js
function submitForm(currentForm) {
    // Add logic here
    // Could be a navigation call, e.g. 
    // navigate.link("submit_form", currentForm)
}

Last updated