1. Introduction
In Oracle APEX applications, user experience (UX) plays a vital role in improving productivity and usability. One common requirement is to automatically place focus on the Search field of an Interactive Report after refreshing the report.
This article explains a simple and effective approach to set focus on the Search field (column search) in an Interactive Report using Dynamic Actions and JavaScript.
2. Tools and Technologies
To achieve the desired functionality, the following technologies are used:
- Oracle APEX
- Javascript
3. Business Requirement
In many enterprise applications, users frequently filter or search data after selecting parameters such as Department, Status, or Category.
The Challenge:
- After clicking the Search button and refreshing the Interactive Report,
- The cursor focus is lost
- Users must manually click on the Search icon again to continue searching.
The solution:
Automatically set focus on the Search icon after the report refresh so users can continue typing or filtering without extra clicks.
โ Improves user efficiency
โ Enhances user experience
โ Reduces unnecessary mouse interactions
4. Implementation Steps
1๏ธโฃ Create an Interactive Report
Create an Interactive Report based on the EMP table.
2๏ธโฃ Create a Page Item (Select List)
Create a page item to filter employees by department.
- Item Name:ย PXX_DEPARTMENT
- Type:ย Select List
Settings:
- Page Action on Selection:ย None
SELECT dname d, deptno r
FROM dept
ORDER BY 2;โก Move this item above the Interactive Report region.
3๏ธโฃ Create a Dynamic action
Create a Dynamic Action on change of page item.
Dynamic Action Details
- Name:ย daChange_Search
- Event:ย Click
True Action 1:
Action: Execute Server-side Code
PL/SQL Code
null;Item to submit: PXX_DEPARTMENT
True Action 2:
Action: Refresh
Region: EMP (Interactive Report)
Fire on Initialization: Off
This refreshes the report based on the selected department.
True Action 3:
Action: Set Focus
Selection Type: jQuery Selector
jQuery Selector:
.a-IRR-button--colSearch:first-of-typeFire on Initialization: Off
โ This automatically places the cursor on the Search icon after the report refresh.
4๏ธโฃ Focus on page load
Create a Dynamic Action on Page load.
True Action:
Action: Set Focus
Selection Type: jQuery Selector
jQuery Selector:
.a-IRR-button--colSearch:first-of-type5๏ธโฃ Save and Run the page.
5. Final Output

โ Preview Image & PDF instantly when file uploaded
โ No page refresh or submit required
โ Improved user experience and data visibility
๐ Conclusion
This approach provides a clean and user-friendly solution for setting focus on the Interactive Report search icon in Oracle APEX. By leveraging Dynamic Actions and jQuery selectors, you can significantly improve usability with minimal effort.
โจ Small UX improvements like this can make a big difference in enterprise applications!
๐ Final Thoughts
If you found this blog useful:
- ย ๐ Likeย
- ๐ Share with your APEX friendsย
- ๐ฌ Comment your feedbackย
- ๐ Bookmark for future referenceย
Happy APEXing! ๐
Love coding? Me too! Letโs keep in touch โ subscribe to my website for regular chats on Oracle APEX, PL/SQL,SQL JavaScript, and CSS.
