Oracle Apex: Open multi dialog page from classic report.
Asalamo Alikom ..
I have a classic report like department list
and i want to link a report column with multiple modal page and its depend on every single department.
Like when i click on ‘IT’ department then open a modal page and when i click on ‘Sales’ department then open different modal page. I need this solution!
Regards..
Steps..
1- create spicial modal page for every department (It, Sales, …).
2- create new column into department table is “dept_modalPageId”
3- create modal page for sales and emp and insert page id into dept_modalPageId column .
4- put dept_modalPageId value = <Dialog page id>
5- create function ..
create or replace function fun_get_url(p_page_no number,itm_nm varchar2, itm_val varchar2)
return varchar2
is
v_url VARCHAR2 (4000);
x_itm_nm VARCHAR2(200);
x_itm_val VARCHAR2(500);
BEGIN
-- configuration --
if itm_nm is not null
then x_itm_nm := itm_nm;
end if;
if itm_val is not null
then x_itm_val := itm_val;
end if;
--
v_url :=
apex_util.prepare_url
(p_url=> 'f?p='
|| v('app_id')
|| ':' ||p_page_no || ':'
|| v('app_session')
|| ':::'
|| p_page_no || ':' --To clear cache page
|| x_itm_nm
||':'
|| x_itm_val
);
RETURN v_url;
END;
6- classic report regin is ..
select DEPTNO,
DNAME,
LOC,
-- pass dialog page id into function to return full URL to dialog page..
case when DEPT_MODALPAGEID is null then null else fun_get_url(DEPT_MODALPAGEID,null,null) end as dialogPage
from DEPT
7- on DIALOGPAGE column (HTML Expression)put this code to handling button to fire dialog page..
<span class="t-Button t-Button--warning" type="button" onclick="#DIALOGPAGE#">Click me</span>
You can see sample @
https://apex.oracle.com/pls/apex/f?p=78167:5
User: help
Pass: help
Try press on “Click me” button into sales and emp row.
I like OracleApex..


