Show / Hide Table of Contents

    View Field Events

    Important

    Custom scripting is very powerful but it should be used with care. Please review the following article.

    Each control supports JavaScript events where a user can hook on. The following events are supported in ADM.

    • OnBlur
    • OnChange
    • OnClick
    • OnFocus
    • OnKeyUp
    • OnLoad
    • ValueChanged
    Note

    In the Ometa Business Connector, it is possible to configure other events. These are only supported in Kendo ADM and jQuery ADM.

    Event Name Friendly Event Name Triggered when
    OnBlur leave the user leaves the control.
    OnChange change the user changes the value of the control.
    OnClick click the user clicks in the control.
    OnFocus enter the user enters the control.
    OnKeyUp type the user releases a key while typing.
    OnLoad load the control is loaded.
    ValueChanged value changed the value of the control is changed.

    Variables

    In all events you have access to the following arguments.

    Argument Type Description
    control BaseControl The component instance.
    viewField ViewField The view field configuration.
    form FormGroupDirective FormGroupDirective
    CSL CustomScriptingLibrary The custom scripting library.

    Onchange and ValueChanged event variable

    These 2 events have an extra parameter which contains the new value of this field.

    Argument Type Description
    value Type of the field The new value of the field.

    KeyUp event variable

    The KeyUp event has an extra parameter which contains the KeyUp event, the key which has been pressed can be checked in this event as well.

    Argument Type Description
    event KeyUp event The key up event which contains the pressed key information.

    Difference Between OnChange and ValueChanged

    The OnChange event is triggered by user interaction. Only when the value is changed by the user, this event is triggered. The ValueChanged event is triggered whenever the value of the control changes. This can happen by the CSL, by update form fields after selection, ...

    Limitations

    Here is the list with known issues / limitations when using events for specific controls.

    Masked Text Box

    The OnChange event for the masked text box is triggered with every key stroke.

    Radiobuttons and Checkboxes

    The OnBlur and OnFocus events are only useful when the user uses the tab key. They are also triggered as the same amount when a user clicks multiple times on the radiobuttons or checkboxes.

    Back to top Copyright © OMETA
    Integrating systems ● Connecting people