Friday 1 September 2017

Copy hidden items to clipboard plugin

At the beginning of 2017 I published a plugin to copy the content of Apex items to the clipboard. I use it on a regular basis in my applications but always for visible elements.
Yesterday I got a comment that the plugin does not handle hidden Apex items correctly. So I set out to create a new version of the plug-in.

In the new version of the plug-in the hidden Apex items are handled correctly and also added support for JQuery selectors.

The new version 1.1 now supports Apex items of type Hidden. This means you can build a string in  hidden item and provide the user with a button to copy the content to the clipboard. Just create a button, add a Click dynamic action to it and supply as action Copy to clipboard [Plug-In]:


In this example the hidden item is called P800_HIDDEN_1.

For the developers that feel at home with JQuery there is the option to reference to DOM elements using JQuery selectors. On the example page you will see a button Introduction to clipboard (JQuery selector) in the header of the Introduction. This button fires the following dynamic action:


The Introduction region has got a static ID INTRO and if you open the inspector you will see that the introduction text is contained in a div element with class t-Region-body. So if you click on the button the text will be copied to the clipboard.
NB Only the first element from the JQuery selection will be used

You can download the new version on http://apex.world

Happy Apexing

2 comments:

Anonymous said...

Hello Dick,
thank you for that nice plugin.

But I have some trouble installing it. Can you provide some more Information how to install.

I imported the file: dynamic_action_plugin_nl_detora_apex_copytoclipboard.sql as plugin. And it's in the shared components plugin list, but I don't see it in the list of possible items. What's the step I'm missing?

Dick Dral said...

Hello,

You won't see it in the list of items. because it is a Dynamic Action plug-in.
So if you create a Dynamic Action you will see the plug-in amongst the possible dynamic actions.