Using Shortcuts
Use shortcuts to avoid repetitive coding of HTML or PL/SQL functions.
- What is a Shortcut?
Use a shortcut to define frequently used code once and then reference it in many places thus reducing code redundancy. For example, you can create a shortcut to define a page control such as a button, HTML text, a PL/SQL procedure, or HTML. - Supported Shortcut Types
Oracle Application Express supports six types of shortcuts. - Defining a Shortcut from Scratch
Define a shortcut on the Shortcuts page. - Copying an Existing Shortcuts
Copy existing shortcuts from the Shortcut repository. - Editing Existing Shortcuts
Once you create a shortcut, you can alter it by editing attributes on the Edit Shortcut page. - Accessing Shortcut Reports
View the shortcut Subscription and History reports.
Parent topic: Managing Shared Components
What is a Shortcut?
Use a shortcut to define frequently used code once and then reference it in many places thus reducing code redundancy. For example, you can create a shortcut to define a page control such as a button, HTML text, a PL/SQL procedure, or HTML.
You can use a shortcut within the following locations:
-
The Region Source attribute of regions defined as HTML Text (with shortcuts).
-
Region Header and Footer Text attribute.
-
Item Label attributes, Pre Element Text, Post Element Text, and Default Value attribute.
-
Region Templates attributes.
Referencing a Shortcut
Once you define a shortcut, you can invoke it using specific syntax unique to the location in which the shortcut is used.
You reference shortcuts using the following syntax:
"MY_SHORTCUT"
The shortcut name must be capitalized and enclosed in quotation marks.
See Also:
Parent topic: Using Shortcuts
Supported Shortcut Types
Oracle Application Express supports six types of shortcuts.
When you create a shortcut you select a shortcut type. Supported shortcut types include:
-
PL/SQL Function Body
-
HTML Text
-
HTML Text with Escaped Special Characters
-
Image
-
Text with JavaScript Escaped Single Quotes
-
Message
-
Message with JavaScript Escaped Special Quotes
Text with JavaScript Escaped Single Quotes
Use this type of shortcut to reference a shortcut inside of a JavaScript literal string. This shortcut defines a text string. When the shortcut is referenced, it escapes the single quotation marks required for JavaScript.
Message
Use this type of shortcut to reference a translatable message at runtime. Since this shortcut does not have a shortcut body, the name of the shortcut must match the corresponding message name. At runtime, the name of the shortcut expands to the text of the translatable message for the current language.
Message with JavaScript Escaped Single Quotes
Use this type of shortcut to reference a shortcut inside of JavaScript literal string and reference a translatable message at runtime.
Parent topic: Using Shortcuts
Defining a Shortcut from Scratch
Define a shortcut on the Shortcuts page.
To define a shortcut:
Parent topic: Using Shortcuts
Copying an Existing Shortcuts
Copy existing shortcuts from the Shortcut repository.
To copy an existing shortcut:
Parent topic: Using Shortcuts
Editing Existing Shortcuts
Once you create a shortcut, you can alter it by editing attributes on the Edit Shortcut page.
To edit an existing shortcut:
See Also:
Parent topic: Using Shortcuts
Accessing Shortcut Reports
View the shortcut Subscription and History reports.
To access shortcut reports:
Parent topic: Using Shortcuts