Toggle menu

helper.showBusy([fieldName] [, size])

This is used to display a spinning busy indicator within the form.

If no arguments are supplied, the busy spinner will display using the default size centred within the area occupied by the form. If a busy indicator is already being displayed on the form it will be replaced.

Executed

Client-side only.

Arguments

ArgumentTypeDescription
fieldNameString, optionalName of the field to be used to position the busy indicator. If missing or blank it will be roughly centred on the form
sizeString, optionalThe size of the busy indicator to be displayed. The available options are 'DEFAULT', 'tiny', 'small' and 'large'. If not supplied the 'DEFAULT' size is used

Example

The busy indicator will most often be used by a developer following a form event which communicates with the API Server and may take some time to return.

This example assumes you are familiar with .utilInvokeAPIServer.

Note how helper.hideBusy is in both the OK and error callback functions.

function(helper, fieldName, value, valid, eventName) {
    if (eventName == 'CHANGE' && valid) {
        helper.showBusy();
        helper.utilCreateAPIServer('APIServer', '/apiserver/ajaxlibrary', {});
        helper.utilInvokeAPIServer('APIServer', 'my.EndPoint', {},
            //The ok function. Hide the busy indicator and do some stuff
            function(data) {
                helper.hideBusy();
                helper.setFieldValue('ANSWER', JSON.stringify(data));
            },
            //The error function. Hide the busy indicator and handle the error
            function(errorDetails, errorMessage) {
                helper.hideBusy();
                helper.setFieldValue('ANSWER', errorMessage);
            });
    }
}

Last modified on May 23, 2024

Share this page

Facebook icon Twitter icon email icon

Print

print icon