User Interface (UI) Defaults in Oracle APEX help developers save time and maintain consistency when building forms and reports. These defaults automatically define how items and columns appear—such as the type of form item used for a particular data type, label settings, validation rules, and formatting preferences. By using UI Defaults, you can ensure that every time a form or report is created from a table, the same design and behavior is applied automatically, reducing repetitive configuration. This is especially useful in applications with many similar data entry or report pages.
User Interface (UI) Defaults in Oracle APEX provide a powerful way to standardize and automate the appearance and behavior of form items and report columns across your applications.
To use UI Defaults effectively, you start by defining default settings at the table or column level, specifying attributes such as item types, display formats, validations, and alignment. These defaults are then automatically applied whenever you create forms or reports based on those tables, saving development time and ensuring consistency.
To begin, you can manage UI Defaults via SQL Workshop by selecting the target table and configuring defaults for each column, such as setting a VARCHAR2 column to use a Text Field or an Email item, or specifying a Date column to use a Date Picker with a particular format. When you generate a form or report in Application Builder, Oracle APEX reads these defaults and applies them automatically to the generated page components.
Additionally, UI Defaults allow you to define report-specific attributes like column alignment, format masks (for currency, dates, or numbers), and whether columns are visible or hidden. This way, reports maintain a consistent look and usability without needing manual adjustments each time.
If needed, you can override these defaults at the page or item level during form or report creation to tailor specific behaviors for certain use cases. This flexibility combined with automation makes UI Defaults an essential feature for efficient Oracle APEX development, enabling standardized design patterns while accommodating individual requirements.
User Interface (UI) Defaults in Oracle APEX offer a comprehensive and standardized method to control the appearance and behavior of forms, reports, and other user interface components throughout your applications. By carefully configuring UI Defaults, developers significantly increase efficiency, maintain a consistent user experience, and simplify long-term application maintenance. When UI Defaults are set prior to page creation, fields, labels, validations, and format masks are automatically applied by APEX, which reduces the need for repetitive manual customization and ensures a uniform look and functionality across all generated forms and reports.
In Oracle APEX, UI Defaults streamline application development by allowing developers to define default settings at the table and column level. These settings control various properties including item types (such as text fields, select lists, or date pickers), display formatting, validation rules, and help text. This standardization promotes usability by ensuring that forms and reports consistently reflect the intended design and business rules, which also accelerates development by eliminating redundant configuration tasks.
UI Defaults are organized into two primary components that work together to enforce consistency:
-
Table Dictionary
-
Scope: Applies specifically to tables and their individual columns within a selected schema.
-
Function: Allows setting default properties such as labels, formatting, default item types, and help text for specific tables and their columns.
-
Priority: When generating pages, settings defined here take precedence and override those specified in the Attribute Dictionary. This allows for table-specific customization when necessary.
-
-
Attribute Dictionary
-
Scope: Applies across all tables within the schema, affecting attributes or column names globally.
-
Function: Establishes default UI settings for attributes by name, ensuring consistent behavior and appearance regardless of which table contains the attribute.
-
Synonyms: Supports attribute synonyms so that multiple column names that represent the same concept can share a unified UI Default definition.
-
By leveraging both dictionaries, developers can enforce consistent UI behavior across multiple pages and applications, simplifying development and enhancing user experience through uniform design patterns and predictable interactions.
To configure UI Defaults in Oracle APEX, navigate to:
SQL Workshop > Utilities > UI Defaults
Example: Setting the "State_ID" Column to Always Appear as a Dropdown (Select List)
A common requirement is to ensure that a column like State_ID always appears as a dropdown list in forms and reports throughout the application. Using UI Defaults, you can define this behavior globally once, and APEX will automatically apply it everywhere the column is used.
Step-by-step process to configure “State_ID” as a Select List using UI Defaults:
-
Access User Interface Defaults:
-
Open your APEX workspace and go to the App Builder.
-
Select Shared Components.
-
In the User Interface section, click on User Interface Defaults.
-
-
Locate the Relevant Table:
-
Use the search box and enter the table name (e.g., People).
-
Select the People table from the results.
-
-
Configure the State_ID Column:
-
Within the People table’s UI Defaults, locate the State_ID column.
-
Set the Item Type to Select List (dropdown).
-
Define the List of Values (LOV) for the select list. This can be:
-
A static list of values representing states (e.g., ‘CA’ for California, ‘NY’ for New York), or
-
A dynamic query that fetches state IDs and names from a States lookup table.
-
-
-
Apply Changes:
-
Save your changes to persist the UI Default configuration.
-
Once configured, any new form or report that includes the State_ID column will automatically render it as a dropdown with the defined list of states. This automatic application eliminates the need to manually adjust the item type for each page.
Additional Considerations:
-
Existing Forms and Reports:
After updating UI Defaults, you may need to manually synchronize or edit existing forms and reports to pick up the new default settings. This typically involves opening the form or report in Application Builder and reapplying defaults or regenerating the page components. -
New Forms and Reports:
Any new forms or reports created after the UI Defaults are set will immediately inherit the defined configurations for the State_ID column and other specified attributes.
Attribute Dictionary
Scope: Affects attributes or column names across all tables.
Function: Establishes default settings at the attribute level, ensuring consistency across different tables.
Synonyms: Supports synonyms, allowing multiple attributes to share a unified definition.
By leveraging UI Defaults, developers can ensure a consistent design and behavior across multiple pages within an application or even across different applications. This simplifies development, reduces manual adjustments, and enhances the overall user experience.
Navigate to : SQL Workshop > Utilities >UI Defaults
To ensure that the "State_ID" column consistently appears as a dropdown (select list) in all forms within your Oracle Application Express (APEX) application, you can utilize User Interface Defaults. This feature allows you to define default settings for table columns, ensuring uniform behavior across various forms and reports.
Steps to Set "State_ID" as a Dropdown Using User Interface Defaults:
Access User Interface Defaults:
Navigate to the App Builder in your APEX application.
Select Shared Components.
Under the User Interface section, click on User Interface Defaults.
Locate the Relevant Table:
In the User Interface Defaults page, find and select the table containing the "State_ID" column.
Configure the "State_ID" Column:
Within the table's settings, locate the "State_ID" column.
Set the Item Type to Select List.
Define the List of Values (LOV) for the select list. This can be a static list or a dynamic query that retrieves state identifiers and names.
Apply Changes:
Save your configurations.
By setting these defaults, any form or report that incorporates the "State_ID" column will automatically render it as a dropdown with the specified list of values, ensuring consistency throughout your application.
Additional Considerations:
Existing Forms and Reports: After updating the UI Defaults, you may need to synchronize existing forms and reports to apply the new settings. This can be done by editing the form or report and reapplying the default settings.
New Forms and Reports: Any new forms or reports created after setting the UI Defaults will automatically adopt these configurations for the "State_ID" column.
Enter “People” in the Search box
Select the tabler name “People”
Select the State_ID column
Using UI Defaults effectively allows you to standardize how your application looks and functions, while still offering flexibility to override these defaults as needed. Whether you're generating a new form, creating a report, or refining the interface for a better user experience, UI Defaults give you a strong foundation to work from. By understanding and applying them properly, you streamline development, enforce consistency, and improve maintainability across your Oracle APEX applications.