Friday, April 10, 2020

Dynamic menu in oracle apex

Create table tree_menu (
  parent_node integer,
  child_node integer,
  menu_desc varchar2(50),
  menu_type varchar2(20),
  page_no integer,
icon_img  varchar2(100)
);


Alter Table Tree_Menu add constraint pk_treemenu
primary key (menu_type, parent_node);


select     level,
        menu_desc as label,
        decode(page_no, null, null, 'f?p=&APP_ID.:'||"PAGE_NO"||':&APP_SESSION.')  as target,
'NO' is_current,
                   icon_img as image
            --decode(page_no, null, 'fa-folder-o', 'fa-file-text') as image
   from (select menu_desc,
parent_node,
child_node,
page_no,
icon_img ,
menu_type
from TREE_MENU T where menu_type = 'HOME')
  start with child_node is null
connect by prior parent_node = child_node
union all
select     level,
        menu_desc as label,
        decode(page_no, null, null, 'f?p=&APP_ID.:'||"PAGE_NO"||':&APP_SESSION.')  as target,
'NO' is_current,
          icon_img as image
        --decode(page_no, null, 'fa-folder-o', 'fa-file-text') as image
   from (select menu_desc,
parent_node,
child_node,
page_no,
icon_img ,
menu_type
from TREE_MENU T where menu_type = 'MAIN')
  start with child_node is null
connect by prior parent_node = child_node


No comments:

Post a Comment

To generate a PDF using JavaScript in Oracle APEX from a collection

  To generate a PDF using JavaScript in Oracle APEX from a collection, you can follow these steps: 1. Create a button or link on your APEX p...