Oracle APEX: How can I programmatically add an Action to a Card in 21.1

1.3k Views Asked by At

I have a page with Card Region. On each card I want to add a button programmatically. Is that possible in APEX 21.2?

2

There are 2 best solutions below

2
On BEST ANSWER

In the card region's attributes tab, you can turn on "advanced formatting" and put a HTML code block including the Javascript function that you want to be executed.

Or, if you want each button to send different parameters to your JS function, in the source of the Cards region, you can call your function as:

select '<button onclick="f_myfunction('||dummy||')">MY BUTTON</button>' button from dual;

This will render each card with the different values sent to f_myfunction as a parameter.

Then in the title, body, etc. attribute of your card region, you can call &BUTTON. after you turn on advanced formatting.

That way you will have button in each card with the call to your function and different parameters.

0
On

Yes you can but not using the "action" property. Instead use "Template Directives" to conditionally render a button element which triggers a javascript event. I can get you an example next week if no one else has a better answer.