• 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 ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

help needed Regarding tree Structure

Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi freinds please help me out with this thing.

i am trying to write a jsp file in which through javascrpt i am trying to creat Tree structure(similar to what you see in wndows explorer),but with very simple things.not all those fundoo hi-fi images of folder or all.

see i am working in WSAD and have a two Bean file (.java fle basically).one of them is RootBean and other is ChildBean.the thngs goes like this that the RootBean has one of its own leafNode and a instance of a childBean and childBean itself contains three leaf nodes.

hence there can be any number of same RootBeans and ChildBeans .

what i have to do is to create the tree dynamically through javascript such that it can display the root bean on top with "+" sign in front of it and on clicking that sign it should explore itself as the contents of rootbean which is something like

+ RootBean
+ ChildBean
- leafNode1
- leafNode2
- leafNode3
- leafNode0

hope you got the flow.!

and so on as amny number of Root Beans can be opened.(there number is fixed say 10 for example.)

the crux of the question is .how to load bean properties in jsp to dsplay dynamically using javascript.

can somebody help me out in this..........

if you have any answers to it please mail me at

Thanx in advance
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you say "how to load bean properties in jsp" (which has to happen on the server side) "to dsplay dynamically using javascript" (client side). So it has to be a server request each time they click a + sign right unless you want to load the whole tree onto the page. I would suppose each "+" sign to be a hyperlink containing the unique id for the corresponding rootbean and upon a click reconstructs the page with data accessed using the unique id.

I don't see the use of javascript coz the page will be reconstructed by JSP. However if the tree is small you could probably load the whole tree and use layers+javascript to make visible/invisible child structure.
Uh oh, we're definitely being carded. Here, show him this tiny ad:
a bit of art, as a gift, that will fit in a stocking
    Bookmark Topic Watch Topic
  • New Topic