Home > Software design >  Retrieve data from a Card in Oracle Apex
Retrieve data from a Card in Oracle Apex

Time:03-30

I have a Card Regions which display some of my tables. I want the cards to each redirect to a certain page based on a number (the number labelled has "page_table" is the page number it will redirect on).

Here's the Query of the Cards Region

SELECT table_name,
REPLACE(SUBSTR(table_name, 8),'_','-') AS nom_table, -- here, i remove the "INV_TB_" prefix from my tables
CASE
WHEN table_name = 'INV_TB_BATIMENT' THEN 11
WHEN table_name = 'INV_TB_CATEGORIE' THEN 12
WHEN table_name = 'INV_TB_DEPARTEMENT' THEN 13
WHEN table_name = 'INV_TB_SERVICE' THEN 14
WHEN table_name = 'INV_TB_POSSEDER' THEN 15
WHEN table_name = 'INV_TB_SITUER' THEN 16
WHEN table_name = 'INV_TB_ETAGE_BUREAU' THEN 16 END AS page_table --this is the column where i define the page number for each table
from cat 
WHERE table_name LIKE 'INV_TB_%'
AND table_name <> 'INV_TB_AMORTISSEMENT'
AND table_name <> 'INV_TB_ARTICLE_LOGS'
AND table_name <> 'INV_TB_ARTICLE_DASHBOARD'
AND table_name <> 'INV_TB_DOCUMENT'
AND table_name <> 'INV_TB_VILLE'
AND table_name <> 'INV_TB_DASHBOARD'
AND table_name <> 'INV_TB_ARTICLE'

Here's the result :

result of the card region


For each one of them, I want to be able to retrieve the number in the little square on the left :

icon and badge


Which will be used to redirect the user to the specific page in Link and Target of the Cards :

enter image description here


I've thought about using an Hidden Item which will receive the value of the square when I click on the card, maybe using JavaScript or jQuery ? Or is there a more easy way to retrieve the value of the custom column "page_table" based on the card I'm clicking on ?

My last solution is to create a table which will contains the name of the real tables, with the page number in real columns, but I would like to know first if my first idea is possible

Thanks in advance,

Thomas

CodePudding user response:

In the cards region, the substitution syntax for columns is &COLUMN_NAME. so in your case &PAGE_TABLE. should work. Can you give that a try ?

  • Related