Skip to main content

Validation Flow

Validation Flow Diagram

The diagram below presents the plug-in validation flow. Each step of the plug-in validation flow is described in the sections below.

Diagram explaining plugin flow

Validation Start

When a dynamic action implementing the plug-in is fired, the plug-in evaluates a combination of dynamic action triggering elements and the plug-in affected elements. The plug-in supports triggering elements such as documentItem(s)RegionButtonInteractive Grid, and Interactive Grid Column(s). Supported affected elements are Not setItem(s)RegionColumn(s).

Before the plug-in validation starts the Validation start event is triggered on the document - dynamic actions listening to this event have access to special validation objects exposed via this.data. A validation start event can be used to display the loading indicator and Validation end to remove it right after validation is done.

HTML5 Validation

HTML5 validations are browser driven validations that ensure that all fields are valid before submitting data to the server. In APEX, HTML5 validations can be applied to page items and Interactive Grid columns using item and column attributes Validation \ Value Required and Settings \ Subtype.

The plug-in performs HTML5 validation on every page item and interactive grid column. If the item or column has HTML5 validation enabled, the plug-in evaluates it and puts every error on the stack to be displayed using the APEX JavaScript API.

Client-side Validation

Client-side validation is performed on every item and column that has a validation qualified as a client-side validation. APEX validation is qualified as client-side if its evaluation can be done without the context of PL/SQL - you can check client-side validations and validation conditions in the Validation \ Validations section.

Native APEX validations that can be executed client-side are fetched from APEX tables by the plug-in when a page is loaded. These validations are evaluated using the plug-in’s predefined JavaScript test functions that represent native APEX validation tests. Thanks to this approach you don't have to write your own JavaScript functions to test the values of items and columns.

If client-side validation fails, errors are put on the stack of validation errors and the validation result is presented to end-user.

To enable client-side validations you must uncheck the Server-side Only plug-in setting. If this setting is checked, then client-side validation is not performed and the plug-in evaluates all defined validation on the server-side only.

Server-side Validation

Server-side validation is obligatory to forbid the end-user to affect validation results. When HTML5 and client-side validations are successful, the plug-in then performs validation on the server-side in the PL/SQL context. Items that are used in teh validation definition (validation expression or condition) are sent to the APEX session using an AJAX call and each validation is performed. The plug-in validation is done in two steps. First, the plug-in performs basic validation and then, immediately after, the plug-in performs the validation defined by the developer in the APEX page designer.

Basic Validation

The basic validation checks whether the item or column has the Validation \ Value Required attribute defined.

Validation End

When validation is finished the plug-in triggers the validation end event on the document and triggers the Item/Column is valid and Item/Column is invalid events depending on the validation result.