Pre-General Availability: 2018-4-26


Oracle Logo
Oracle Application Express JavaScript API Reference

This section describes the JavaScript APIs available to Oracle Application Express applications. You can use these functions to provide client-side functionality, such as showing and hiding page elements, or making Ajax (Asynchronous JavaScript and XML) requests.

Most of the Application Express JavaScript APIs are organized into namespaces. A namespace is simply a global singleton object that contains a number of functions. There is one top level Application Express namespace called apex. This has a number of sub namespaces such as apex.server and apex.util. Namespaces help to organize code and reduce the chance of name conflicts with other JavaScript libraries.

There are some older global functions that are not in a namespace. Most of these start with a $ character. These are known as Non-namespace APIs.

Some functions return an interface, which is an object that contains functions known as methods and variables known as properties, that allows access to a specific instance of a page component or other entity.

Application Express also includes a number of UI widgets based on the jQuery UI widget factory. Widgets are high level user interface components such as menus, trees, or grids. Application Express makes it easy to declaratively add components such as items and regions to a page. Internally some components are implemented using these widgets. Default component behavior does not require any JavaScript programming. To implement advanced use cases you can leverage the documented widget methods, options and events.

TODO describe how to know which APIs are available when i.e. desktop vs mobile, core/default vs need to load a specific file.

Adding JavaScript to an Application Express application

TODO describe how to include/call JavaScript code in an APEX page

Legacy JavaScript APIs

Work has commenced to reduce the overall size of JavaScript that is loaded by Oracle Application Express when rendering a page. JavaScript functions that are no longer served on every page are gradually being moved to a legacy JavaScript file, which can be found in /i/libraries/apex/legacy.js.

When developing applications, a developer has the option to either include, or not include the legacy JavaScript functions. This is achieved by using the Include Legacy JavaScript property on the User Interface Attributes page under the application's Shared Components.

Existing applications are migrated with this option enabled, for backward compatibility. To not include this legacy file, you need to go through the functions listed in the legacy file, and search your application and associated JavaScript files for any references to those files. If you are happy that there are no references to these functions, you can switch off including the legacy file and benefit from the slightly smaller library.

When developing new applications, the legacy file is included by default in all applications that use a Desktop User Interface Type. New applications that use a jQuery Mobile Smartphone User Interface Type do not include this file.

For both new and existing application development, Oracle recommends that you do not continue to use any of the functions in legacy.js, to reduce your dependency on this legacy JavaScript.