Introduction This blog explains about, how we can hide the Parameters & values in URL of oracle APEX.
Procedures Step 1: Copy & Compile the Below code (Function)
CREATE or replace FUNCTION sj_dyn_url_func ( p_redirectappid VARCHAR2, p_redirectsession VARCHAR2, p_redirect_page VARCHAR2, p_editname VARCHAR2, p_actualpageno VARCHAR2, p_actuaparams VARCHAR2 DEFAULT NULL ) RETURN CLOB /*P_PARAM VARCHAR2 (300) :='PARAM1+VALUE1-PARAM2+VALUE2-PARAM3+VALUE3'; */ AS lv_result CLOB; BEGIN lv_result := '<a href="'||APEX_UTIL.PREPARE_URL( p_url => 'f?p='||p_redirectappid||':'||p_redirect_page||':'||p_redirectsession||':::'||p_redirect_page||':P'||p_redirect_page||'_PAGENO,P'||p_redirect_page||'_PARAMS:'||p_actualpageno||','||p_actuaparams, p_checksum_type => 'SESSION') ||'">'||p_editname||'</a>'; return lv_result; END;
Step2 : Create a Classic report , set the type as "SQL Query".
Code:
SELECT DEPTNO, DNAME "Default Edit", sj_dyn_url_func(:APP_ID,:APP_SESSION,'3',DNAME,'2','P2_PARAM1+'||DEPTNO||'-P2_PARAM2+'||DNAME||'')as "Custom Edit" FROM DEPT
Step3: Select the Column "Default Edit" & set the link , here I have used form page No "2".
Note : Create Form Page based on the edit link of the report.
Select the Column "Custom Edit" & set the Escape Special Characters to "NO"
Step4 : Create Common Redirect Page, Here I have created page as "3".
Create Three Text field Page Items in that page & named as
P3_APPID P3_PAGENO P3_PARAMS Step5 : Copy the below code & Create PLSQL Process & set the Execution point as "After header"
DECLARE P_PARAMETERS VARCHAR2(4000) :=:P3_PARAMS; LV_RESULT VARCHAR2(4000); CURSOR C1 IS select ''''||REPLACE(COLUMN_VALUE,',',''',''')||'''' AS COLUMN_VALUE from table (apex_string.split(REPLACE(P_PARAMETERS,'+',','),'-')); BEGIN FOR I IN C1 LOOP LV_RESULT :=LV_RESULT|| 'APEX_UTIL.set_session_state('||I.COLUMN_VALUE ||');'||CHR(10); END LOOP; LV_RESULT :='Begin '||LV_RESULT||' end;'; execute immediate LV_RESULT; apex_util.redirect_url ( p_url => (APEX_UTIL.PREPARE_URL( p_url => 'f?p='||:P3_APPID||':'||:P3_PAGENO||':&APP_SESSION.:::', p_checksum_type => 'SESSION')) ); END;
Output:
Happy Coding....
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.