Search code examples
oracle-apex-5

APEX 5 link Modal Page in IR cell


I work on APEX 5 application and want to have link to modal page in IR. When I put in select select '<a href="f?p=&APP_ID.:2:&SESSION.">' || col1 || '</a>' col1, ... get an error ORA-00911: invalid character, but if I change page 2 from Modal to Normal everything is fine. Where do I make mistake?


Solution

  • Implement links to modal page using declarative approach rather than deriving it using query. This can be done by changing the column type to Link and then mention link target and link text, screenshot below:

    enter image description here

    If this does not work for you and you want to do it through query then use APEX_UTIL.PREPARE_URL function is your query like this,

    SELECT
        COL1, 
        COL2, 
        '<a href="' || APEX_UTIL.PREPARE_URL(P_URL => 'f?p=' || V('APP_ID') || ':2:' || V('APP_SESSION'), P_CHECKSUM_TYPE => 'SESSION') || '">' || COL1 || '</a>' LINK 
    FROM 
        TABLE1
    

    More Information on PREPARE_URL function can be found here --> link