Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
Updated 13-Aug-17 2: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

Try using the style attribute, as described at HTML DOM Style visibility Property[^].
 
Share this answer
 
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

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900