Dynamic Triggered Action in Cards
Dynamic Triggered Action in Cards
A hands-on look at triggered actions in Cards, with everything I discovered building it from scratch.
The Wall I Kept Hitting
If you have been working with the Cards region in Oracle APEX for a while, there is a good chance you have hit the same wall I kept hitting. You can set up a Card, wire up an action on the Title, the Full Card, the Subtitle, even the Media area — but the moment you wanted that action to do something a little smarter (show a confirmation dialog, set a page item, fire some JavaScript, display a success toast), you ended up writing custom JavaScript, hacking link targets, or building workarounds with hidden buttons.
This post is essentially my notebook from exploring that feature — what I tried, what I noticed, and what I think every APEX developer should know about it.
What Card Actions Looked Like Before 26.1
Before diving into the new stuff, here is the setup. In a Cards region, you can wire up actions on several distinct parts of each card:
Before 26.1, if you wanted any of these to do something dynamic, you were writing JavaScript inside link targets or building elaborate hidden-button patterns. The framework gave you a click surface but not a logic engine. That gap is now closed.
Full Card Triggered Action
The Full Card action fires whenever a user clicks anywhere on the card surface that is not a dedicated button or inline link. The first thing I wanted to test was the simplest possible setup, just to confirm the feature actually works end to end. So I went with a toast notification.
Here is the configuration path inside Page Designer:
Cards region → Attributes → Actions → Full Card → Triggered Actions node → right-click → Create Dynamic Action
True Action: Show Success Message
Action Type : Show Success Message Message : Full card clickable successfully Affected : Full Card surface
That is literally the entire setup. When I clicked the KING / PRESIDENT card in my region, the green success toast slid in at the top right of the page. No JavaScript. No plug-in. No workaround.
Worth calling out: Show Success Message is itself new in APEX 26.1. Previously you would have written one of these inside an Execute JavaScript action:
apex.message.showPageSuccess("Full card clickable successfully");
Now it is a fully declarative config option. Multiply that across a whole codebase and the cleanup adds up fast.
Subtitle Triggered Action
My Cards region had the JOB column bound to the Subtitle (PRESIDENT, MANAGER, and so on). What I wanted was: when a user clicks the subtitle, show a toast that displays the actual role from that row. This is where the dynamic per-row behaviour gets interesting.
The trick is using $v('JOB') inside the JavaScript action. It reads the current row value at runtime from the Cards region context.
Cards region → Attributes → Actions → Subtitle → Triggered Actions
apex.message.showPageSuccess("Selected Role: " + $v('JOB'));
Click the PRESIDENT subtitle on the KING card: the toast reads Selected Role: PRESIDENT. Click MANAGER on the BLAKE card: the toast reads Selected Role: MANAGER. Same dynamic action, different rows, different output. No page reload required.
If you prefer staying fully declarative, the new Show Success Message action also accepts the &JOB. substitution syntax directly in the message text. Inside Execute JavaScript blocks though, stick with $v().
Title Action: Redirect with Link Builder
For the Title action, I wanted clicking the employee name to navigate to a dedicated detail page pre-populated with that employee's data. This is one of the most common real-world patterns I build: a tile-based listing where clicking the name opens a full detail view.
Here I did not use Triggered Actions. Instead I used the Link Builder with a Redirect to Page in this Application target. When the goal is straightforward navigation with value passing, that is the cleaner fit.
| Setting | Value |
|---|---|
| Action Type | Redirect to Page in this Application |
| Target Page | 4 |
| Page Item | Value (Substitution) |
|---|---|
P4_ENAME | &TITLE. |
P4_JOB | &SUBTITLE. |
P4_SAL | &SALARY. |
APEX resolves those substitution strings at runtime for the row being clicked and passes them as URL parameters into the target page items. Page 4 receives them and loads the correct employee data instantly.
&TITLE., &SUBTITLE. are the Cards region logical column aliases, not the raw SQL column names. If your region maps ENAME to the Title column, the substitution is &TITLE., not &ENAME..
SELECT ENAME, JOB, SAL FROM EMP WHERE ENAME = :P4_ENAME
If you need to pass a primary key instead of display values, add EMPNO as an additional Set Item with &EMPNO. as its value, then source Page 4 from the database using that key. That is the safer, more robust pattern for production apps.
Media Area Triggered Action
The Media area is the image or icon section rendered at the top or side of each card. Before 26.1, clicking the media area was either a full-card redirect or completely ignored. Now it is its own distinct interactive surface, and this is genuinely one of my favourite additions in the whole release.
My Cards region query for this test looked like this:
SELECT EMP_ID, EMP_NAME, JOB_ROLE, SALARY, EMP_IMAGE FROM EMP
EMP_IMAGE was mapped to the Media column in the Cards region attributes, so each card rendered the employee photo as a clickable image. Clicking it navigates to Page 5, which shows a Classic Report for that employee.
| Setting | Value |
|---|---|
| Action Location | Cards region → Attributes → Actions → Media |
| Action Type | Redirect to Page in this Application |
| Target Page | 5 |
| P5_EMP_NO | &EMP_ID. |
| P5_JOB | &JOB_ROLE. |
SELECT EMP_ID, EMP_NAME, JOB_ROLE, SALARY, EMAIL, DEPARTMENT, HIRE_DATE FROM EMP WHERE EMP_ID = :P5_EMP_NO AND JOB_ROLE = :P5_JOB
The results: Salary, Emp Id, Emp Name, Job Role, Email, Department, and Hire Date all load for whichever employee photo was clicked. For product grids, employee directories, content dashboards with thumbnail previews, this pattern now takes minutes to build declaratively.
Things I Picked Up Along the Way
-
Value Protected is your friend. If a Card carries a primary key that gets submitted or passed to another page, mark it Value Protected. Treat the browser as an untrusted environment at all times.
-
New notification actions pair perfectly. Show Success Message, Show Error Message, and Clear Errors work beautifully alongside Card Triggered Actions. You can remove almost every one-liner JavaScript toast call from your codebase.
-
Page Designer Rendering tree is the source of truth. Resist right-clicking the card preview in the visual canvas. The Triggered Actions node lives in the tree, not the layout pane.
-
Action order matters. APEX runs True Actions top to bottom. Always set values before opening dialogs or refreshing regions downstream.
Final Thoughts
I have been working with APEX long enough to remember when adding any custom behaviour to a Card felt like fighting the framework. With FR-1983 in APEX 26.1, that friction is essentially gone. If you maintain even one APEX application that uses Cards, this feature is worth refactoring for. Your logic becomes declarative, visible in Page Designer, and debuggable without digging through hidden JavaScript. The scattered workarounds are finally behind us.
▶ Live Demo
Comments
Post a Comment