Search code examples
oracleweburloracle-apex

Adding hyperlink to a row and displaying the specific row in another page


I have two APEX Web Application pages containing the following columns:

Table 1:
Column1    Column 2 Column 3
a           x         123
b           y         456
c           u         567
d           v         678
e           w         789

Table 2 URL: https://example.com
Table 2:
ColumnA    ColumnB    ColumnC
a             aa         1234
c             vv         2222
b             ac         7654
e             cc         6789
d             kk         9809

Note: Column 1 and columnA are same values but jumbled

If I click on table 1 column1 'b', it should take me to the page containing table 2 row values of 'b'. If I click on 'b' in table 1 the output should open in another page something like the following:

Table 2
ColumnA    ColumnB    ColumnC
b             vv        2222

What I tried so far?

I tried editing the URL: https://example.com/#COLUMNA# but it displays the entire table and not the specific hyperlinked row.

How can I solve this?


Solution

  • Here's how:

    • on the second page, create a hidden item :P2_COLUMNA

    • modify its query to use that item in the WHERE clause, e.g.

      select ... from table2 where columnA = :P2_COLUMNA
      
    • on the first page, use a link colum type for the column1 and set

      • target to a page in this application (the second page, right?)
      • set items: P2_COLUMNA to #COLUMN1#
    • run the first page; when you click the value used as a link, it'll redirect you to the second page, populate the hidden item which will - in turn - be used in the second page's WHERE clause and display values you're expecting