how to display treeview in jsp

Posted on 2007-03-31
Last Modified: 2011-09-20
Hi Experts,

I have a JSP page which will display a list in each column.
I have a BL list and Container List , 1 BL can contain 1 or morethan 1 containter.

I need to display these items in treeview using Javascript or JSP.

Ex:  +BL

and ones the user clicks on + sign
then it should be like


My Jsp code looks like

<display:column title="BL Number" property="blNumber" group="1" align="left" />
<display:column title="Container Number" property="containerNumber" align="left"/>      

right this will display like


Question by:gannev

Accepted Solution

mukhtar2t earned 250 total points
ID: 18830838
LVL 17

Assisted Solution

gops1 earned 250 total points
ID: 18831562
Try out this simple demonstration:

            <title>Script Demo Gops</title>
                        li ul{display:none;}
                        ul li{color:blue;text-decoration:underline;cursor:pointer}
                  <script type="text/javascript">
                        var oldMenu="";
                        function showHide(obj){
                              if(oldMenu) oldMenu.childNodes[1].style.display='none';
                              if(oldMenu==obj) {oldMenu=""; return true;}
      <li onclick="showHide(this);">BL1
                  <li>Container 1 BL1
                  <li>Container 2 BL1
      <li onclick="showHide(this);">BL2
                  <li>Container 1 BL2
                  <li>Container 2 BL2

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: : Click on Too…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

810 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