Introduction
Interactive reports serve as pivotal components in Oracle Application Express (APEX), offering users a dynamic platform to explore and interact with data. Implementing row click functionality allows users to extract specific information from rows effortlessly.
The following technology has been used to achieve the expected output.
- JAVASCRIPT
- Oracle Apex
Why we need to do
we’ll outline the steps to enable row click functionality on an interactive report, retrieving the value of a particular column.
How do we solve:
Following steps explains in detail,
The following table is used for this process.
Step 1: Assign a Static ID
Begin by assigning a static ID to the relevant HTML element. For instance, designate the static ID as “my_static_id”.
Step 2: Add Static ID to Column
Within the interactive report, assign a static ID to the column from which you wish to retrieve data. Let’s use “ENAME” as an example.
Creating the Page Item: To hold the value extracted from the row click, create a page item named “P19_ENAME”
Step 3: Creating the Dynamic Action
3.1 Navigate to Dynamic Actions: Access the dynamic actions section in Oracle APEX.
3.2 Create a New Dynamic Action: Initiate a new dynamic action, selecting the “Click” event on jQuery Selector #my_static_id td.
3.3 Define Action Parameters: Specify the action details within the dynamic action setup.
3.4 Select Action Type: Choose “Execute JavaScript Code” as the action type.
3.5 JavaScript Implementation:
apex.item(“P5_ENAME”).setValue($(this.triggeringElement).closest(‘tr’).find(‘td[headers=”ENAME”]’).text())
Customize the JavaScript code by replacing “my_static_id” with the actual static ID assigned to the HTML element and “ENAME” with the static ID of the target column.
Step 4: Save and Validate
Save the dynamic action configuration.
Step 5: Test the Functionality
Click on a row within the interactive report to ensure the JavaScript code executes correctly, logging the value of the specified column to the browser console.
Conclusion:
Output:
Enabling row click functionality in interactive reports enhances user experience and facilitates seamless data extraction. By following the outlined steps, you can effortlessly implement this feature in Oracle APEX applications, empowering users to interact with data more intuitively. Should you encounter any issues, verify the implementation of JavaScript code and debug using browser developer tools.