This site is currently read-only as we are migrating to Oracle Forums for an improved community experience. You will not be able to initiate activity until January 30th, when you will be able to use this site as normal.

    Forum Stats

  • 3,889,964 Users
  • 2,269,775 Discussions
  • 7,916,823 Comments

Discussions

Copy the contents of the region to the clipboard in APEX

Niki Dilip
Niki Dilip Member Posts: 18 Blue Ribbon

Hi,

I have a region in a page ,which has contents displayed using a dynamic plsql content. I do not have any page item in that page. How can I copy the contents of the region to the clipboard using copy button(I have created a copy button , created a dynamic action onclick). Also, is there any way i can copy them to a file as well?

PS: I want to copy a region content and not the content of the pageitem.

Thanks & Regards

Best Answer

  • Adnan3114
    Adnan3114 Member Posts: 13 Red Ribbon
    edited Aug 2, 2022 2:31PM Answer ✓

    Give your PL/SQL content body an HTML ID (DIV or SPAN) and create dynamic action Execute javascript Code.

    A Simple example:

    HTML Body:

    <span id="copy_this">Copy this content to clipboard!</span>

    Javascript Execution Code for Button DA:

    var copy_data = document.getElementById("copy_this").innerText;navigator.clipboard.writeText(copy_data); console.log(copy_data);

    InoL

Answers

  • InoL
    InoL Member Posts: 10,361 Blue Diamond

    There are a few clipboard plugins (search for "clipboard"):

    apex.world/ords/f?p=100:700

    (I cannot directly copy the URL of this site, so use copy-paste)

    It looks like they work on items, but you may be able to modify one of these plugins to work on a region.

  • Adnan3114
    Adnan3114 Member Posts: 13 Red Ribbon
    edited Aug 2, 2022 2:31PM Answer ✓

    Give your PL/SQL content body an HTML ID (DIV or SPAN) and create dynamic action Execute javascript Code.

    A Simple example:

    HTML Body:

    <span id="copy_this">Copy this content to clipboard!</span>

    Javascript Execution Code for Button DA:

    var copy_data = document.getElementById("copy_this").innerText;navigator.clipboard.writeText(copy_data); console.log(copy_data);

    InoL