How To Store Application Link on Oracle APEX to Create Dynamic Link Menus

This article will discuss about how to store application link on Oracle APEX to create dynamic link menus. When we develop some application usually there will be 2 main areas which are public area and admin area. Public area will show all of prohibit pages/contents on the application to public users. Admin area’s itself will controlling pages/contents that allowed to be viewed by public user. On some application there will found the public area controlling their own pages/contents such as adding a page.

Oracle APEX has a specific format to access its pages from a web browser. The format might be like this:


APP_ID                 = Application ID that we created
PAGE_ID              = Destination page ID will be shown
APP_SESSION    = Session ID from browser session
params                 = parameter that given from user interactions

This article will show you how the public user control its page/content by creating a dynamic menu based on table records. Each of page references will be stored on tables and will be able to be viewed on public area.

First create new desktop application on Oracle APEX then follow the following steps:
1.       Create table named Project
2.       Create Page, Add PL/SQL Dynamic Content Region
HTP.P('<TR BGCOLOR="#cccccc"><TH>Project ID</TH><TH>Project NAME</TH></TR>');
                FOR a IN (
                                                APEX_ITEM.TEXT(1,null,4) ID, APEX_ITEM.TEXT(2) NAME
                                FROM DUAL)
                                FOR i IN 1..5 LOOP
                                END LOOP;
                END LOOP;

When it executed the appearance will be like this:

3.       Add a button or the region
4.       Create PL/SQL Process, assign to button
                id VARCHAR2(8);
                name VARCHAR2(32);
                par VARCHAR2(128);
    a VARCHAR2(8);
    b VARCHAR2(8);
                FOR i IN 1..apex_application.g_f01.count LOOP
                                id := apex_application.g_f01(i);
                                name := apex_application.g_f02(i);
                                par := 'P3_ID:'||id;
                                IF id IS NOT NULL THEN
INSERT INTO project(projectid,projectname,params) VALUES(id,name,par);
                                END IF;
                END LOOP;
5.       Add TEXT item => P3_ID
6.       Add Report Region
a.       Source
select projectid, htf.anchor('f?p='||:APP_ID||':3:'||:APP_SESSION||'::::'||params,projectname) projectname from project
b.      Report Attributes, edit PROJECTNAME attribute, Display as: Standard Report Column
7.       Run, fill the fields, klik Save

8.       Results

9.       Klik on Projectname Link, if you click One the Id will be filled by 1. This means that if we click on One link it will be open a pege with PAGE_ID=1;

That’s it our discussion about store application link on Oracle APEX. This methods can be applied on dynamic APP_ID or the dynamic parameter passing.

Thank You - Bobsis

No comments

Powered by Blogger.