Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


how to create a dynamic menu with forms 6i?

Posted on 2003-03-12
Medium Priority
Last Modified: 2008-02-26
   I am beginer of developer 2000.Now I have been created customised menus,that has contained three levels i.e main menu,sub menu & sub menu's sub menu.Now my question is how can I create the menu dynamically from one or more tables.How can I give access specified menus to individual user and disable remaining menu items.Then I would like the user to only see menu options that he/she can execute based on the roles he/she has.  Also, it needs to be easily maintainable so that I don't need to change the application's menus everytime a new option is added or deleted.
Could u please give proper solution but not using ROLES.It's better give me an example of dynamic menus that are table driven not use Oracle roles.  
This is an urgent.My work has been stop due to this.

Question by:zhangrui
LVL 15

Accepted Solution

andrewst earned 100 total points
ID: 8118763
So you won't be using Forms Builder menus then - they cannot be built dynamically at runtime, and access is via ROLES.

I don't see how you are going to achieve this unless you don't mind your menus not looking like a standard Windows menu.  Building a data model for table-driven menus and user access rights is pretty simple - I can go into more details if necessary.

The problem is how to display that menu.  Again, it is easy enough if you don't mind it having a non-standard look and feel.  For example, you can use the tree-structure approach:

- Main Menu
  + Employee Menu
  - Manager Menu
    o Hire Employee
    o Fire Employee
  + Admin Menu

I am confused as to why you say:
a) "I would like the user to only see menu options that he/she can execute based on the roles he/she has", but
b) "Could u please give proper solution but not using ROLES"

Why re-invent the wheel?

Assisted Solution

sfardin earned 100 total points
ID: 8118793
One approach is to create a table to contain all the users with menu name accessible to them. Write code in 'Start up code' of the menu to query users record and enable/disable them as per their rights.  But this requires to create all the menu/submenu and menu item in Menu. Altough this is a easy solution, it requires a bit of maintanence. FOr every new menu item , you need to add them in your mmb file and database.

Other approach is to create a table which will contain user_name, menu_name, parent_menu, module_type and access_path. Create a multiple record block form to query and display menu options avl for current user.  Either provide them with button or write 'When double click' triggger on this display item to call the corresponding module. for e.g.
a typical record in your table will have.
User_name Menu_name, Parent_menu module_type access_path
user123   Mfg reps   Core Mfg    Report      < act path with report name >

When user selects this option, a call like run_product (module_type, access_path ,...) is executed.

I hope i'm clear in explaining my point  

Author Comment

ID: 8123801
 Thank you very much!The tree-structure is a good approach,but i only want a standard menu like powerbuilder's.the questions confused u are mean the menu item should be visible but greyed out if he/she only has the 'display' role not 'excute' role.Now i want to implement the menu with the following tables:
table menu_authority:
authority_code varchar2(2) not null/* the value like '00'
authority_type varchar2(20)/*value=administrator

table menu_classes:
menu_id number(2) not null
menu_label varchar2(20)
table menu_item:
table menu_all


LVL 13

Expert Comment

ID: 10093929
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Split: andrewst {http:#8118763} & sfardin {http:#8118793}

Please leave any comments here within the next seven days.

EE Cleanup Volunteer

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
Suggested Courses
Course of the Month12 days, 10 hours left to enroll

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question