Search This Blog

Showing posts with label Configure UI Defaults in APEX. Show all posts
Showing posts with label Configure UI Defaults in APEX. Show all posts

Monday, June 30, 2025

How Do I Configure UI Defaults in APEX

 Introduction

Configuring UI Defaults in Oracle APEX is a powerful way to standardize the appearance and behavior of forms and reports throughout your application. Instead of manually setting labels, item types, and formatting each time you create a page, UI Defaults let you define these preferences once at the table and column level. As a result, APEX will automatically apply your settings during page generation, saving development time and ensuring a consistent user experience.

To configure UI Defaults in Oracle APEX, you begin by defining how your tables and columns should behave when they are used to create Forms, Reports, or other components. These settings allow you to predefine labels, display types, formatting masks, alignments, and validation rules. UI Defaults are especially helpful when working with standard data structures, ensuring consistency across applications.

To start configuring UI Defaults, open your APEX workspace and follow these steps:

  1. Access the UI Defaults Interface
    Navigate to SQL Workshop > Object Browser.
    Locate the table for which you want to define defaults. Click the table name.
    On the right, select the UI Defaults tab.

  2. Define Table-Level Defaults
    In the UI Defaults tab, at the top, you can configure settings that apply to the entire table.
    For example, you can choose whether checkboxes or radio groups are used for certain column types.
    You can also define the default report type (e.g., Interactive Report) that should be used when the table is selected in wizards.

  3. Define Column-Level Defaults
    Below the table settings, you’ll see each column listed. For every column, you can define:

    • Label: The default label shown in forms and reports

    • Display Type: Choose from text field, number field, email item, select list, etc.

    • Format Mask: Set number/date formatting (e.g., 999,999.99 or DD-MON-YYYY)

    • Column Alignment: Align text left, center, or right in reports

    • Width: Default width of the column in reports

    • Validation: Add rules like required values, minimum or maximum numbers, or patterns

  4. Save UI Defaults
    After making changes, click Apply Changes to save your settings. These UI Defaults are now stored in your workspace metadata.

  5. Use UI Defaults in Wizards
    When you create a new Form or Report using the APEX wizards, your UI Defaults will automatically be applied. This includes item types, formatting, and labels, reducing the amount of manual configuration needed.

  6. Review and Update UI Defaults as Needed
    As your application grows or business rules change, revisit the UI Defaults and adjust them to reflect updated design standards or validations. Changes to UI Defaults do not automatically update existing pages, but they will apply to new pages created after the update.

In Oracle APEX, UI Defaults streamline development by allowing you to define how form items and report columns should appear and behave based on table and column metadata. These settings can be configured either through SQL Workshop or directly during page creation in Application Builder. Below are the two main ways to manage UI Defaults.

A. Defining UI Defaults in SQL Workshop

To define UI Defaults from SQL Workshop:

  1. Navigate to SQL Workshop > Object Browser

  2. Click the name of the table for which you want to define defaults

  3. Open the UI Defaults tab

  4. For each column, you can configure:

    • Item Type: Choose from options like Text Field, Select List, Date Picker

    • Display Options: Set column alignment or define the item as read-only

    • Validation: Define rules like required fields or numeric format masks

  5. Click Apply Changes to save the configuration

Once saved, these UI Defaults are automatically applied anytime this table is used to generate a Form or Report within APEX.

B. Applying UI Defaults During Page Creation in Application Builder

You can also use UI Defaults during the creation of Forms and Reports:

  1. Open Application Builder

  2. Click Create Page

  3. Choose Form or Report

  4. Select the table that already has UI Defaults configured

  5. APEX will apply all default item types, validations, and display settings automatically

UI Defaults for Form Items

Oracle APEX supports specific UI Defaults based on data types to ensure proper control selection and formatting. Here are common examples:

  • VARCHAR2: Text Field, Textarea, Email Item

  • NUMBER: Number Field, Slider, Format Mask like 999,999.99

  • DATE: Date Picker, with formats such as DD-MON-YYYY

  • CLOB: Rich Text Editor or Textarea

  • BOOLEAN: Yes/No Switch or Checkbox

  • Foreign Keys: Select List or Popup LOV

For instance, a STATUS column with values like "Active" or "Inactive" can be configured to use a Radio Group, improving usability.

UI Defaults for Reports

When generating reports, APEX can also apply column-level UI Defaults. These include:

  • Alignment: Set text to left, center, or right

  • Display Type: Choose Plain Text, HTML, or a Hyperlink

  • Format Mask: Define number, currency, or date formatting

  • Visibility: Hide columns that aren't essential to the report

For example, a PRICE column can be set to:

  • Format: $999,999.99

  • Alignment: Right

  • Aggregation: Display a SUM at the bottom

These configurations ensure that every new Classic Report or Interactive Report using the table automatically inherits the desired formatting and behavior.

By using UI Defaults effectively, you can streamline your development process, minimize repetitive configuration, and ensure all your pages have a consistent look and behavior. This is particularly useful in larger applications with many forms and reports.

In Oracle APEX, UI Defaults streamline development by allowing you to define how form items and report columns should appear and behave based on table and column metadata. These settings can be configured either through SQL Workshop or directly during page creation in Application Builder. Below are the two main ways to manage UI Defaults.

A. Defining UI Defaults in SQL Workshop

To define UI Defaults from SQL Workshop:

  1. Navigate to SQL Workshop > Object Browser

  2. Click the name of the table for which you want to define defaults

  3. Open the UI Defaults tab

  4. For each column, you can configure:

    • Item Type: Choose from options like Text Field, Select List, Date Picker

    • Display Options: Set column alignment or define the item as read-only

    • Validation: Define rules like required fields or numeric format masks

  5. Click Apply Changes to save the configuration

Once saved, these UI Defaults are automatically applied anytime this table is used to generate a Form or Report within APEX.

B. Applying UI Defaults During Page Creation in Application Builder

You can also use UI Defaults during the creation of Forms and Reports:

  1. Open Application Builder

  2. Click Create Page

  3. Choose Form or Report

  4. Select the table that already has UI Defaults configured

  5. APEX will apply all default item types, validations, and display settings automatically

UI Defaults for Form Items

Oracle APEX supports specific UI Defaults based on data types to ensure proper control selection and formatting. Here are common examples:

  • VARCHAR2: Text Field, Textarea, Email Item

  • NUMBER: Number Field, Slider, Format Mask like 999,999.99

  • DATE: Date Picker, with formats such as DD-MON-YYYY

  • CLOB: Rich Text Editor or Textarea

  • BOOLEAN: Yes/No Switch or Checkbox

  • Foreign Keys: Select List or Popup LOV

For instance, a STATUS column with values like "Active" or "Inactive" can be configured to use a Radio Group, improving usability.

UI Defaults for Reports

When generating reports, APEX can also apply column-level UI Defaults. These include:

  • Alignment: Set text to left, center, or right

  • Display Type: Choose Plain Text, HTML, or a Hyperlink

  • Format Mask: Define number, currency, or date formatting

  • Visibility: Hide columns that aren't essential to the report

For example, a PRICE column can be set to:

  • Format: $999,999.99

  • Alignment: Right

  • Aggregation: Display a SUM at the bottom

These configurations ensure that every new Classic Report or Interactive Report using the table automatically inherits the desired formatting and behavior.

Conclusion
By taking a few minutes to configure UI Defaults in APEX, you can significantly increase development efficiency and enforce uniform design standards across your application. Whether you're building a simple form or a complex report, UI Defaults reduce repetitive tasks and promote best practices. As your application evolves, these defaults help maintain consistency and improve long-term maintainability.