Click here to Skip to main content
13,259,976 members (50,298 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
In my application I have three listitems File Upload,View Reports and Change Password. I need to hide View Reports if the login is by normal user and i need to display View Reports if the login is by manager. Below is the code of my tabs
 
Code in master page-
 
<div class="wrapper">
        <div class="menu">
             <div class="menu">
                <ul id="drop-nav">
                    <li id="MenuFileUpload" runat="server"><a href="Upload.jsp">File Upload</a>
                        <ul>
                            <li><a href="ViewUploadedFiles.jsp">View Uploaded Data</a></li>
                        </ul>
                    </li>
                     <li id="MenuReports" runat="server"><a href="Reports.jsp" id="Rpf" runat="server">View Reports</a><ul>
                         <li><a href="Reports1.jsp">Report1</a></li>
                         <li><a href="Reports2.jsp">Reports2</a></li>
                         <li><a href="Report3.jsp">Report3</a></li>
                         </ul>
                     </li>
                         <li id="lichangepwd" runat="server"><a id="A1" href="ChangePassword.jsp" runat="server">Change Password</a></li>
                    <div style="width:auto;float:right;font-weight:bold;padding-right:0cm;">
                        <li id="lilogout"><a href="Logout.jsp"> Logout</a></li></div>
                     <div style="float: left;text-align:right; width: 64%;"> 
                    <asp:Label ID="lblmsg" runat="server" ForeColor="Red" BorderColor="White" Text="Label" Font-Size="Small"></asp:Label> </div>
 
                </ul>
 
             </div>
 
        </div>
 
code in login page-
 
if(role.equals("Supervisor"))
{
reports.visible=false; 
}
 

I had tried by making reports.visible=false; which we will do in .net but its not working in java


What I have tried:

I had tried by making reports.visible=false; which we will do in .net but its not working in java
Posted 12-Aug-17 21:12pm
Updated 13-Aug-17 3:06am
Comments
Kornfeld Eliyahu Peter 13-Aug-17 2:19am
   
What 'reports' is in your context?
Member 12324523 13-Aug-17 2:26am
   
i wan to hide view reports if i hide view reports the sub list items under view reports also gets hided

View Reports
Report1
Reports2
Report3


this is what i want to hide view reports
Member 12324523 13-Aug-17 12:46pm
   
i had tried by placing this piece of code in my servlet


if(role.equals("Supervisor"))
{
reports.visible=false;
}

but its not working

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Try using the style attribute, as described at HTML DOM Style visibility Property[^].
  Permalink  
Comments
Member 12324523 13-Aug-17 9:45am
   
i tried but its not working can you show me how to do that as i am new to this i need to hide in servlet and bring the id from master page
Richard MacCutchan 13-Aug-17 10:25am
   
Please edit your question, show exactly what you have tried, and explain what did not work.
Member 12324523 13-Aug-17 12:49pm
   
i had tried by placing this piece of code in my servlet


if(role.equals("Supervisor"))
{
reports.visible=false;
}

but its not working
Richard MacCutchan 13-Aug-17 13:26pm
   
Where and what is the object named reports and does it have a visible property?
Member 12324523 13-Aug-17 13:37pm
   
View Reports
Report1
Reports2
Report3



this is what i want to hide in this we have view reports know that i need to hide
Richard MacCutchan 13-Aug-17 13:44pm
   
Sorry but that does not make any sense with your previous answer. You can only hide specific visual objects.
Member 12324523 13-Aug-17 13:51pm
   
then how can i hide that second list item view reports i need to hide that if role is user and i need to display that if role is supervisor

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web04 | 2.8.171114.1 | Last Updated 13 Aug 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100