Mapping between event names and callback types for callbacks that can be registered via XUtil.on.

Hierarchy

  • XUtilCallbacks

Index

Properties

addRow

addRow: function

When a row with a repeated element or container was added.

param

Data with added row.

Type declaration

afterLoadFormData

afterLoadFormData: function

A callback for when form data was loaded via $.xutil.load. This callback is invoked after the form data was loaded and the form was updated with the new data. You can use this callback to perform additional actions after the form was loaded, such as updating the UI of rich widgets.

param

Data passed by the framework with the form data that was loaded.

Type declaration

afterPrint

afterPrint: function

A callback for printing the form. The callbacks are invoked after a form was printed (such as by the print service). You can use this callback to undo preparations made by print.

param

Data passed by the framework for the print operation.

returns

A promise that resolves the clean up is done.

Type declaration

afterSaveFormData

afterSaveFormData: function

A callback for when form data was saved via $.xutil.save. This callback is invoked after the form data was saved. You can use this callback to perform additional actions after the form data was saved, such as inserting additional data into the form data.

param

Data passed by the framework with the form data map to fill.

Type declaration

beforeClearAll

beforeClearAll: function

Before the values of a set of form elements are cleared.

params

Data with the form element.

Type declaration

beforeLoadFormData

beforeLoadFormData: function

A callback for when form data is about to be loaded via $.xutil.load. This callback is invoked at the beginning, before any other form data was loaded. You can use this callback to perform additional actions, such as adjusting the DOM or inserting additional form data. You can also use the return value to exclude certain elements from the default handler that loads all data for .XItem elements.

param

Data passed by the framework with the form data to be loaded.

returns

Optional result object that can be used e.g. to exclude certain elements from the default handler.

beforeResetAll

beforeResetAll: function

Before the values of a set of form elements are reset to their default values.

params

Data with the form element.

Type declaration

beforeSaveFormData

beforeSaveFormData: function

A callback for when form data is about to be saved via $.xutil.save. This callback is invoked at the beginning, before any other form data was saved. You can use this callback to perform additional actions, such as adjusting the DOM or inserting values into the form data. You can also use the return value to exclude certain elements from the default handler that saves all data from .XItem elements.

param

Data passed by the framework with the form data map fill.

returns

Optional result object that can be used e.g. to exclude certain elements from the default handler.

clear

clear: function

When the value of a form element was cleared.

params

Data with the form element.

Type declaration

deleteRow

deleteRow: function

When a row with a repeated element or container was deleted.

param

Data with added row.

Type declaration

disable

disable: function

When a form element was disabled.

params

Data with the form element.

Type declaration

enable

enable: function

When a form element was enabled.

params

Data with the form element.

Type declaration

fileChange

fileChange: function

When a file was changed, both for normal and for automatic upload elements.

params

Data with the form upload element.

Type declaration

hide

hide: function

When a form element was switched from visible to hidden.

params

Data with the form element.

Type declaration

print

print: function

A callback for the print service. The callbacks are invoked when just before a form is printed (such as by the print service). You can use this callback to prepare the form for printing. When the callback returns a promise, the print service waits for the promise to fulfill before printing the form. When the promise is rejected, the error is logged, but does not prevent the print.

To clean up after printing, use afterPrint.

param

Data passed by the framework for the print operation.

returns

A promise that completes when the preparations are done.

Type declaration

readOnly

readOnly: function

When a form element was set to read-only.

params

Data with the form element.

Type declaration

resetAll

resetAll: function

When a set of form elements hda their values reset to the default values.

params

Data with the form element.

Type declaration

show

show: function

When a form element was switched from hidden to visible.

params

Data with the form element.

Type declaration

submit

submit: function

A callback for when the form is submitted. Can be used e.g. to run additional actions or to prevent the submission.

The callback is called after the form was validated, if the submit button requires validation.

$.xutil.on("submit", () => doSomething())

$.xutil.on("submit", ({submissionBlocked}) => {
  // Check if the submission is already blocked
  if (submissionBlocked) {
    return;
  }

  // Custom code to be run on submission
  // Custom logic to check whether the form submission should be cancelled.
   const preventSubmission = customLogic();

   return { preventSubmission };
});
param

Data with the form and whether the submission was already blocked.

returns

Optional result data that can be used e.g. to prevent the submission.

Type declaration