Use APEX Shortcuts for your Clear Item Button or Link
You probably know how to add a button or link to clear the value of an item. You may have seen the button on apex.world when you search for a plug-in, for example.
You can use a Dynamic Action that executes a “Set Value” or a fairly straight-forward code like this:
What I like to do is define APEX Shortcuts. You find them under Shared Components > Other Components > Shortcuts
There are two Shortcuts I usually create and use them depending on how well they fit:
- A button CLEAR_BUTTON
- A text link CLEAR_LINK
Once these Shortcuts are defined I can simply type
"CLEAR_LINK" in the “Post Text” field of an Item.
View the Demo Here.
Here is the end result:
Final Note: I may be using APEX 20.1 for the screenshots, however, I’ve been using this feature since APEX 4.2!!!
PS. Thanks to Ronny Weiss correcting a typo and for reminding me that this solution doesn’t look as great with Floating Labels. What I suggest is to remove the
a-Button--popupLOV classes and instead turn on the “Display as Block” Template Option. The end result can be seen below. For the icon option, you can do something similar, but you may want a little more styling.