Oleksii Nikulin
Oleksii Nikulin

Reputation: 73

How to open internal APEX link in HTML

I am using APEX from Oracle and have one interesting situation. As you might know, APEX gives you an opportunity to generate buttons with link on another page, transferring variables from one page to another.

Now I am creating an HTML region using "Static Content" and want to create a button in HTML with the same functionality as built-in in APEX.

Example of the APEX link:

'f?p=254:32:&APP_SESSION.::::P32_IST_SOLL,P32_MODELL,P32_ZEIT_ID,P32_TYP,P32_GEWERK:SOLL,&P2_MODEL.,&P2_AKT_MONAT_ID.,KREDIT,&P2_GEWERK.'

Every value between "&" and "." is a name of the variable on the current page. Do you have any ideas how to let variables into link and overcome this problem? Thank you.

Upvotes: 1

Views: 2308

Answers (1)

Justin Audet
Justin Audet

Reputation: 154

You didn't really specify what "problem" you want to overcome so I'll try to cover as much as possible.

First problem I occured trying to achieve what you were trying

The Security > Page Access Protection page attribute in the target page is by default Arguments Must Have Checksum

You can either prepare your URL using the APEX PREPARE_URL function : https://docs.oracle.com/database/apex-5.1/AEAPI/PREPARE_URL-Function.htm#AEAPI160 (Safest option)

Or you could set the target page security setting to Unrestricted (which makes the page subject to URL tampering and could be a security issue)

The other problem I faced was that by default on apex the <button> type attribute is by default set to submit, which could be easily fixed like so:

<button type="button" onclick="window.location.href='f?p=&APP_ID.:3:&APP_SESSION.::NO:RP:P3_TARGET_1,P3_TARGET_2:&P11_ITEM.,&P11_OTHER.';">Button Text</button>

Where &P11_ITEM. is the assigned value of P3_TARGET_1 in the target page and &P11_OTHER. is the assigned value of P3_TARGET_2 respecting the same order the target page item's are called.

Upvotes: 1

Related Questions