Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

how to create a tree structure in jsp

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
Can i be able to create a tree structure in jsp.I mean.Parent node and child nodes.Expanding the parent displays the childs,and also be able collapse it..Data is loaded from database.Any idea?pls help me..thanks
 
Ranch Hand
Posts: 489
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The jsp for this should be pretty straight forward and would involve getting the right data avilable to the page. The expanding and collapsing effect (the tree part) on the browser is achieved using javascript and you would need more than a superficial knowledge of javascript to code it. Recommend that you go through this taglib and adapt it for your needs.

ram.
 
meera jan
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
in the sample ,they are using one tld named taglib.tld
.From where i will get it?should i download something?
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
You can achieve this functionality using XML.
Load your data into an XML, whose structure you will have to define according to your database table design.
Next, you can use XSL to render the XML onto a jsp page.
The xml file can be set as the src of a frame and u wl be able to see the functioanlity u desire.
The toggle effect can be got by the following javascript code:
function showBranch(branch){
//alert("branch opened with id value : " + document.getElementById(branch).cname);

var objBranch = document.getElementById(branch).style;
if(objBranch.display=="block")
objBranch.display="none";
else
objBranch.display="block";
swapFolder('I' + branch);

}

function swapFolder(img){
objImg = document.getElementById(img);
if(objImg.src.indexOf('images/closed.gif')>-1)
objImg.src = openImg.src;
else
objImg.src = closedImg.src;
}
 
ramprasad madathil
Ranch Hand
Posts: 489
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by meera jan:
hi,
in the sample ,they are using one tld named taglib.tld
.From where i will get it?should i download something?



You will have to download the jar that contains the taglib classes and place them in your application's WEB-INF/lib directory.

ram.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Nupur Khanna

Can you please provide an example or url demonstrating the procedure you have explained.
Thanks in advance
 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I need a Jsp Code to generate tree Structure. it no need to connect to database just while running time it want to show some data in tree structure



Thanks in advance. please help me as soon as possible.
 
Greenhorn
Posts: 1
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Jenifer,
You can use the jquery tree structure to make a tree structure in your jsp page.
Following url can help you up Jquery tree.

 
Sheriff
Posts: 22796
131
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jenifer Rajkumar wrote:Thanks in advance. please help me as soon as possible.


Please EaseUp.

And welcome to the Ranch to both of you!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic