Introduction
One of the most common UI patterns in database
applications is the Master-Detail layout a page where selecting a row in
a "master" list dynamically loads related records in a
"detail" section. For example, selecting a Service Request in a list
might load all associated Work Orders below it. This pattern eliminates the
need for separate pages and gives users a seamless, real-time experience.
Oracle APEX supports this pattern through a combination of column links, hidden page items, and partial-page
refresh (Dynamic Actions).
This article discuss how to implement it from creating the hidden item to configuring
the column hyperlink and writing the detail query.
This
guide describes how to configure a Master-Detail page in Oracle APEX so that
clicking a Service Request ID column of the master report dynamically refreshes
the associated detail region. The approach uses a column link to pass the
selected value into a hidden page item, which the detail query then uses as a
bind variable to filter its results.
Prerequisites
Before following this make sure you have the following in place:
• An existing APEX application with at least one page
• A Master region already created an Interactive Grid
that displays a list of records (e.g., Service Requests)
• A Detail region on the same page an Interactive
Grid that will display related child
records (e.g., Work Orders)
• Both regions query the same Oracle Database schema,
with a parent-child relationship between tables ( joined on SER_REQ_ID)
• Developer access to App Builder for the application
How It Works: The Core Concept
The Master-Detail link works through a three-part
chain:
1. Hidden Page
Item: Acts as a shared variable between the master and
detail regions. When a user clicks a row in the master report, APEX stores the
selected value (e.g., a Service Request ID) in this hidden item.
2. Column Link: A hyperlink configured on a column in the master report. When clicked,
it submits a partial page request, sets the hidden item value, and triggers a
refresh of the detail region — all without a full page reload.
3. Bind Variable in Detail Query: The detail region's SQL query uses the hidden page item as a bind
variable (e.g., :P398_SER_REQ_ID). Each time the hidden item changes, APEX
re-executes the detail query and refreshes the results.
Together, these three components create a
dynamic, interactive Master-Detail experience entirely within a single APEX
page.
1. Navigate
to Oracle APEX → App Builder → Your Application → Pages.
2. Open
the page that contains your Master and Detail Region.
3. The Master and Detail region is Report
or Interactive Grid.
Figure 2 – Select Title and Type for Master and Detail Region
Step: 2 – Create the Hidden Page Item
A hidden page item acts as the
communication bridge between the master and detail regions. When a user clicks
a row in the master report, APEX stores the selected value in this item, and
the detail query reads it via a bind variable.
1. In
Page Designer, right-click on the Content Body in the layout canvas and select
Create Page Item
Name: P398_SER_REQ_ID
Type:
Hidden
Value Protected: No
Note:
The item name must follow the convention P{page_number}_{ITEM_NAME}. Since this
page is Page 398, the item is named P398_SER_REQ_ID. Setting Value Protected to
No allows the column link to pass a value into it at runtime.
3. Click
Save to confirm the new page item.
Step: 3 – Select the Target Column
1. In
Page Designer, click on the Master Region in the layout .
2. Under
Columns, select the SER_REQ_ID column — this is the column users will click to
load the associated detail data.
Step: 4 – Configure the Column as a Hyperlink
1. With
SER_REQ_ID selected, open the Property Editor panel.
2. Expand
Column Formatting → Link.
3. Configure
the link properties as shown in the table below.
|
Property |
Value |
|
Target |
Page in this Application |
|
Page |
398
(the current l page) |
|
Set Items |
P398_SER_REQ_ID |
|
Values |
#SER_REQ_ID# |
Confirm that the detail region’s SQL
source references the page item P398_SER_REQ_ID as a bind variable. The
relevant filter conditions should read:
Query Where Clause:
Example: WHERE vsm.ser_req_id = :P398_SER_REQ_ID
Step: 6 – Test the Master Detail Link
1. In App Builder, click Save and then Run Page to launch the application in a new tab.
2. In
the master report, click any Service Request ID link.
3. Confirm
that the detail region immediately refreshes to display only the work orders
associated with the selected request.
4. Click a different Service Request ID and confirm the detail
region updates accordingly.

Figure 6 – Master-Detail page in
action after selecting a Service Request
Conclusion
The Oracle APEX Master-Detail link built using a
hidden page item, a column link, and a bind variable in the detail query is a
powerful and efficient way to create interactive, data-driven pages.
The same approach can be extended to more
advanced scenarios:
• Multiple detail regions refreshed by the same master
click
This scenario is an important step in building
professional APEX applications.
• Oracle APEX Documentation - https://docs.oracle.com/en/database/oracle/apex/
• Oracle APEX Community Forum - https://apex.oracle.com/forum








Comments
Post a Comment