[ADF, JDev 12.1.3] How to hide menu items based on the logged in user

Hallo,

When the user logs on successfully, the applitacions led him to the main.jspx page.

The main.jspx page has a menu bar that contains all of the available menus, submenus and menu items.

After the connection, when the main.jspx page loads I would hide all the menus, submenus and menu items that the user is not qualified to see/use (I read the database).

You kindly tell me which is the way the cleaner to achieve?

Thank you

Federico

user10709360 wrote:

Hello rohanwalia,

Sorry, but I need more help

I guess that the solution is to create a method in the AM who - reading form the database - returns a structure that indicates for each menu item should be visible or hidden.

  • How can I use the data returned by this method?
  • I call in a managed bean specifically dedicated to the management of the menu? Can I also use the already existing media bean, I created for the page?
  • What scope should have the bean?
  • Don't you think that it is better to define a 'visible' variable Boolean (initilized depending on the result of the AM method) for each menu item and how to bind the Visible property of each menu item to the variable respective in the bean in the bean?
  • Or I can loop the result of the method AM setting the Visible property of the menu items? In this case, I guess that all the menu items must be mapped into the bean by user interface variable. Am I wrong?
  • Is it not possible to write a method which, of the AM directly, hide the menus not necessary on the page (so without using a bean)?
  • In general, which are the correct always to hide menu items:
    • (1) before the page is sent to the browser (as "I can do it with PHP);
    • (2) once the page is loaded in the browser (as I can do it with JavaScript)?

If you could give me some more detailed advice... I would be very happy.

Thank you

Federico

(1) its best to make the treatment inside the method. You can return the parameters as normal java method.

(2) Yes, you can use bean already exists in the project. But better to create a separate bean for this task of menu.

(3) scope should be request unless you need to persist the attributes between requests.

(4) Yes it is possible. You can define and initialize a Boolean variable with the results you get from the table based on the menu items should be made visible.

(5) If you use the approach to point 4, then also you have to loop through the table menu items and set Boolean variables of bean. Yes you are right for the second part.

(6) I'm not sure about this approach. How will you map it to your menu mode. It takes research.

(7) before the page is loaded. I share with you links in above post with which you can do this.

I hope this helps.

Thank you

Tags: Java

Similar Questions

  • Show/hide menu based on the logged in user

    Hello

    12.1.3 Jdev

    I want to show/hide some menu items based on the logged in user.

    I will explain the current design:

    In my application, I created a menu as below. (It is created using 'Create or Update ADF Menu' file adfc_config).

    ibis_menu. XML

    <?xml version="1.0" encoding="windows-1252" ?>
    <menu xmlns="http://myfaces.apache.org/trinidad/menu">
      <itemNode id="itemNode_home" label="Home" action="goHome" focusViewId="/home"/>
      <itemNode id="itemNode_transaction" label="Transaction" action="goTransaction" focusViewId="/transaction"/>
      <itemNode id="itemNode_customer" label="Customer" action="goCustomer" focusViewId="/customer"/>
      <itemNode id="itemNode_upload" label="Upload" action="goUpload" focusViewId="/upload"/>
      <itemNode id="itemNode_profile" label="Profile" action="goProfile" focusViewId="/profile"/>
      <itemNode id="itemNode_serviceRequest" label="Service Request" action="goServiceRequest"
                focusViewId="/serviceRequest"/>
      <itemNode id="itemNode_report" label="Report" action="goReport" focusViewId="/report"/>
    </menu>
    

    I have a navigation pane in my Pages that use this menu as below:

    <af:navigationPane hint="bar" id="np1" value="#{ibis_menu}" var="menuInfo">
                            <f:facet name="nodeStamp">
                                <af:commandNavigationItem id="ni1" text="#{menuInfo.label}"
                                                          destination="#{menuInfo.destination}"
                                                          action="#{menuInfo.doAction}"/>
                            </f:facet>
                        </af:navigationPane>
    

    Now, I want to hide some items on the menu, depending on the Type of user loggedIn. I have the userType stored in the managed bean.

    How can I get this feature.

    An approach which I think is as below:

    Define a variable for each itemNode in a managedbean(session scope) and who associate with the property ' visible ' / ' rendering ' of the itemNode in the Menu xml.

    Please let me know is a good way to do it or is there another solution better?

    See you soon

    AJ

    So, maybe this can help:

    http://www.Oracle.com/technetwork/developer-tools/ADF/learnmore/48-sitemenu-protection-169190.PDF

  • : How to hide menu items in blackberry?

    I'm developing an application. In this application, I had created a main screen. On the main screen, I had added a button field. When I clicked on this button field to open my popup screen it will open my popup screen but it also shows menu items all that I added to my main screen in front of the screen. However, I do not want to display these menu items but do not want to open my popup screen when clicking on this button then, how do I do this?

    create the button with the style CONSUME_CLICK.

  • How to hide a field based on the value of a field of a different subform - controls null does not work!

    I use Javascript to define actions. I need to hide a text field, if the value of a field in another subsidiary form is zero.

    -J' tried to check the value in the other field NULL - does not work

    -J' tried affecting a variable str2 where I know that the value in the other field is available, then checking this variable when I initialize the text field - does not work

    What Miss me?

    Hello.

    Try this in the form of native void, referring to the text field (X).

    If (this.rawValue = 1)

    {

    X.Presence = "visible";

    }

    ElseIf (this.rawValue = null)

    {

    X.Presence = 'hidden ';

    }

  • How to add dynamic items based on the results of a dynamic query?

    Hi all

    I'm quite new to ofa, here's my problem.

    I have a table 'interventions', each intervention have actions stored in the table "actions".

    I want to show the actions of an intervention in a list, based on the id of the intervention. the response ID value is dynamic, so does not know the number of shares that you want to display in the list.

    Can someone tell me the steps to create a region that has dynamic elements to display names of action?

    Thank you

    Kind regards

    Afaf

    Afaf,.

    Take a look on the link below to see how to create dynamic VO:

    Blog of Anil Oracle Application Framework: create VO when running at the controller or dynamically created VO

    You could add messageStyled text like the code below:

    OAMessageStyledTextBean newMessageBean = (OAMessageStyledTextBean) createWebBean (pageContext, MESSAGE_STYLED_TEXT_BEAN, null,"" ");

    Links to dynamically create elements below:

    Add columns to the table advanced in OA Framework Programatically by Extension

    OPS KNOWLEDGE HELPER

    Let us know if you get any errors when creating.

    See you soon

    AJ

  • How to highlight the menu item based on the position of the scrolling page?

    Hello

    I am interested by learned how to achieve the effect in the upper left corner of this Web page:

    http://trashpixels.co/#one

    When you click on any of the six gray menu icons (grey rectangles), you scrolled down to the deep page and arrive at the location one or two or four or what you clicked on... it's easy. But how do I get the menu item (a rectangle) to be highlighted (change to green) to indicate the current position on the web page?

    Any suggestion would be appreciated

    Thank you

    Bradley

    Hi Bradley

    You can use the anchor links for menu items that would be would be the active state once that section of the specific page of scrolling.

    This video explains the process:

    https://www.YouTube.com/watch?v=qNsI6DHz5Co

    Thank you

    Sanjit

  • Jdev v.10.1.3.4 - hide inputtext af based on the drop-down list box

    Hello

    I'm trying to hide and display a text entry box based on what is selected by a drop-down list box. I have some difficulty getting the javascript code I think that to read the value of the selection box.

    Here is a simple example of what I'm trying to do. I tried a couple of different ways but no luck. I appreciate any help anyone can offer.

    Thank you
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://xmlns.oracle.com/adf/faces" prefix="af"%>
    <%@ taglib uri="http://xmlns.oracle.com/adf/faces/html" prefix="afh"%>
    <f:view>
      <afh:html>
        <afh:head title="test">
          <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
    
        </afh:head>
        <afh:body>
    <f:verbatim>
            <script type="text/javascript">
            function changed(){
               if(document.getElementById("current").value =="1" ){
                document.getElementById("currentSize").style.display='block'; //show textbox
                }
                else{ 
                document.getElementById("currentSize").style.display='none'; //hide textbox
                }
            }
            
            </script>
    </f:verbatim>
        
        
        
        <h:form>
            <af:selectOneChoice id="current" label="select item" onchange="change();">
              <af:selectItem label="item 1" value="1"/>
              <af:selectItem label="item 2" value="2"/>
              <af:selectItem label="item 3" value="3"/>
              <af:selectItem label="item 4" value="4"/>
            </af:selectOneChoice>
          <af:inputText label="Input Size:" maximumLength="5" id="currentSize" columns="7" rows="1"/>              
          </h:form></afh:body>
      </afh:html>
    </f:view>

    It works if you use af:form instead of h:form?
    What happens if you set the partial relaxation of the af: form to point to the 'current '?

  • Hide an item based on the valve

    Hi All-

    I have 2 valves (think clamshell has and valve B in this case). When the form appears Valve A a text element should display. When the form shows the text element of valve B do not show (it should hide the form). I know that I have to give a condition for this article, but I'm not sure what to give.

    Appreciate your help,

    Kind regards
    Nani (Version 3.2 of the Apex).

    Novice,

    For your article, there is an attribute of type condition. Set it to the "value of the point in Expression 1 is NULL". 1 expression of the value = "VALVE_B" (or whatever the name of the page for valve b element).

    (I couldn't say if you mean valve or value)

    See you soon,.
    Janet Tyson

  • Hide a line based on the State.

    Hello, I have a requirement where I have to hide a line based on the State. I am able to highlight the lines but hide the entire line does not work.

    Condition must be met on a line:

    • Thus, if a sum of EXP5_11, EXP6_11, EXP7_11 and EXP8_11 in a current group is all zeros hide this line. Please refer to the RTF-model.

    Attachments:

    • RTF-model.
    • XML file.
    • Sample output generated when the lines are highlighted the meeting status.

    Any help is much appreciated on how I can hide a line.

    EM-: [email protected]

    If please remove your IF condition and add the following code inside the foreach tag

    This works very well in my test.

  • How do I move items added in the taskbar

    How do I move items added in the taskbar

    Click the icon to the left and drag it where you want.
     
     
  • How - add a menu item custom application BlackBerry

    I'm working on an application that creates a custom in various standard Blackberry applications menu item.
    On the platform of v4.2.1.72 8800 2.3.0.54 everything works fine all the Blackberry PIM application that the spectacle of my menu item mail application custom.

    When I load on platform 8330 v4.3.0.124 3.1.0.71 none of the custom menu to the top and on the OS of the Pearl Flip is v4.6.0.48 4.1.0.13 only e-mail and todo/tasks application view my custom menu others do not show my menu item.

    I tried to compile my app in the various versions of the JDE, but always the same question.

    Am I missing something for the new OS?  I followed the knowledge base article "how - to add a custom BlackBerry application menu item.

    I tested it on 8800 v4.5.0.52 platform 2.7.0.66 and Mail and Memo shows no custom menu item in Contacts, calendar and ToDo my custom menu appears.

    Thank you...

    BTW do you know if I can add menu browser and retrieve the content of the web page?

    No, this is not supported.

  • How to replace filtering engine based on the Windows Component?

    HI - how to replace filtering engine based on the Windows Component?

    See the link below.   This fix is well worth trying, but if your system has been damaged by malicious programs such as Sirefef there may be more issues involved.

    blogs.technet.com/b/asiasupp/archive/2011/12/27/error-code-0x80070424-with-Windows-Firewall-and-quot-base-filtering-engine-service-quot-not-available-in-services-database-list.aspx

  • How to create a report based on the item selected from the list of selection?

    Hello

    I created a tables_LOV based on:

    Select table_name table_name user_tab_cols r, d

    where column_name like '% _type % '.

    Then I created a ListOfTables page element, display in a selection list and pointing to tables_LOV.

    I run the page, and I can choose the table I want in the drop-down list.

    How to create a report based on the selected element? (ex: select * from selected_table)

    Thanks in advance

    Salah

    Hi Salah,

    Allright, take a look at this page: http://apex.oracle.com/pls/apex/f?p=vincentdeelen:collection_report

    I think that simulates what you are trying to accomplish. I've implemented the simplest method I could think of.

    The report is based on a collection of apex. If you are not familiar with this, you should study the documentation: APEX_COLLECTION

    To recreate my example, you should:

    (1) create a report (interactive) on your collection

    SELECT *
       FROM APEX_collections
     WHERE collection_name = 'MY_COLLECTION'
    

    (2) create a selection list page_item for the tables that you want to display (in my case, this is called "P38_TABLES")

    (3) create a dynamic action that triggers on the evolution of your selection list page_item. Dynamic action must be a parade of PL/SQL procedure the following code:

    declare
      l_query varchar2(4000);
    begin
      l_query := 'select * from '||:P38_TABLES;
      if apex_collection.collection_exists
            ( p_collection_name => 'MY_COLLECTION' )
      then
        apex_collection.delete_collection
          ( p_collection_name => 'MY_COLLECTION' );
      end if;
    
      apex_collection.create_collection_from_query
        ( p_collection_name => 'MY_COLLECTION'
        , p_query           => l_query
        );
    end;
    

    Make sure that you add your page_item 'Page to send items' section.

    (4) add a real extra action that makes an update of the report area.

    Here are two photos describing the da:

    http://www.vincentdeelen.com/images/OTN/OTN_COLLECTION_REPORT_DA1.PNG

    http://www.vincentdeelen.com/images/OTN/OTN_COLLECTION_REPORT_DA2.PNG

    Good luck and greetings,

    Vincent

    http://vincentdeelen.blogspot.com

  • Several list drop-down menu items to fill the area of separate text even. How can I do?

    Acrobat x Pro, I have figured out how to create a dropdown menu with items that will populate a separate text box, but how do I get several menu items to fill the text box. For example. My menu has three items, cat, dog, mouse. I choose the cat and it appears in the separate text box (hooray). Then I choose "dog" in the same menu. I would like it to appear in the text box even my previous selection 'chat '. Is this possible? I am very new to JavaScript, any help would be greatly appreciated! Thank you

    Change the last line:

    getField("Text_field_1").value += "" + aQuotes [point];

  • How to choose a Rotator ad based on the location of users

    I have the following requirement and do not know how you can achieve what no main script is allowed in British Colombia

    On each page a set of ad rotators are displayed based on the location of users - this could be a casual user, wandering on the web site or of a registered member.

    There are more than 400 regions of advertising (lets just call them cities).  When a user walks on the web site, we know the IP address and can then determine the city with external services.

    Now that we know the city the person comes, we want to present the page with the correct sequence.

    It's obviosly not a good idea to load 400 banner ads and expose the required.

    Can someone help me with this problem?

    I'm no expert on JSON/JQuery/AJAX etc, a few examples would be appreciated.

    Thanks in advance

    You can go this way:

    -Create a folder where you create pages for each banner, something like/banner/london.html, /banner/newyork.html and so on

    -place an adrotator on each page

    -on the model where you need to have made banner insert the script that you use to determine the exact location of the user and the name of the city translates

    -create a .js which takes the name of the city and jQuery.load () the corresponding page in the folder banner, here are a few examples of the load method - http://www.w3schools.com/jquery/ajax_load.asp

    I hope this helps!

    PS - you can even have a single page for all the adrotator, each wrapped in a div with a unique ID 'city' and load the div containing the necessary adrotator, something like:

    {module_adrotator, 15264}

    {module_adrotator, 15265}

Maybe you are looking for

  • dv7t-6100cto: which improved processors will work in this notebook

    I'm getting a new computer in the near future or upgrade the one I have. I don't know which processor upgrade path has this computer. Here are the specs: Chipset HM65, taken G2 (rPGA988B), 165 m, I7-2720QM card mother HP. On the Intel websitethere ar

  • LabVIEW 2009 Crash when record for previous

    I'm having a problem when you try to save a VI in LabVIEW 2009 to a previous version of LabVIEW, in this case 8.2, but itseems crashing no matter which version I chose.  I've narrowed the problem down to this: If the vi contains a structure of event

  • Bought 5 sets of laptop HP Pavilion G4. I can create recovery disc 1 game...

    Just bought 5 sets of laptop HP Pavilion G4. Can I create 1 1 of the laptop recovery disk and use it for all? Also or I can clone the recovery partition in a laptop and use it to others. Please advice.

  • Microsoft stops working when I want to play a game installed

    I recently bought a game on big fish site, and when I go to turn it on, a window of microsoft windows is telling me that the game has stopped working. Ive checked with the site and everything seems to be working there. It happened also when I bought

  • I can't access hotmail in "windows live".

    When I try to log in my "windows live hotmail" or (hotmail, messenger) I can't access it because it a dialog box appears saying that I should first update "windows live". Windows live downloads updates and then installs them, but when the installatio