📋Improving UX in Oracle APEX: Copy Select List Values to clipboard Without Plugins
🚩Introduction
In Oracle Application Express (APEX), Select List items are commonly used to provide predefined values and ensure data consistency. However, APEX does not offer a built-in declarative option to copy the selected value directly using the mouse. Since it is rendered as a dropdown list, the displayed value cannot be highlighted and copied like a standard text field.
This limitation can be resolved by creating a custom Dynamic Action using JavaScript. The selected value can be captured programmatically and copied to the clipboard without using plugins. This approach improves usability while maintaining the standard behavior of the Select List component.
📑Why It Is Essential to Enable Copy Functionality for Select List
In Oracle Application Express (APEX), Select List values often contain important reference data that users may need to reuse. Since the dropdown content cannot be directly highlighted and copied, it can affect the user experience.
Enabling copy functionality improves efficiency, reduces manual retyping errors, and enhances overall user experience without modifying the standard Select List behavior
Enable users to copy the selected value from a Select List easily
-
Avoid manual retyping and reduce data entry errors
-
Trigger additional actions based on the copied value if needed
-
Improve overall user efficiency and workflow within the page
-
Maintain the standard Select List behavior without using plugins
👉 Steps to Enable Copy Functionality for a Select List
Step 1:
/* Sample SQL Query for the LOV */ SELECT 'One' d, 1 r FROM dual UNION SELECT 'Two' d, 2 r FROM dual UNION SELECT 'Three' d, 3 r FROM dual
Step 2:
<span id = "copyIcon" class = "fa fa-clipboard" style = "cursor:pointer" onclick = "copytoclipboard()"></span>
Step 3:
/* Function & Global Variable Declaration Section */ function copytoclipboard() { // replace with your select list page item name below (P19_SELECT) var selectedValue = apex.item("P19_SELECT").displayValueFor($v("P19_SELECT")); if(selectedValue != "") { navigator.clipboard.writeText(selectedValue); apex.message.showPageSuccess("Copied"); } else { alert("Please select any value to copy..."); } }
/* Css */ /* Replace with your select list page item name (change the highlighted word #P19_SELECT) */ #P19_SELECT_CONTAINER .t-Form-itemText--post { padding: 5px; border: 1px solid #eee; background-color: #eee; }








Comments
Post a Comment