File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes help needed Regarding tree Structure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "help needed Regarding tree Structure" Watch "help needed Regarding tree Structure" New topic

help needed Regarding tree Structure

Akhil Jain
Ranch Hand

Joined: Oct 14, 2004
Posts: 74
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

-------------------------------<br />you can't move ahead, unless you try for it.
Sudhir V
Ranch Hand

Joined: Dec 25, 2002
Posts: 143
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.

Sudhir V<br />(SCJP 1.2, SCWCD, OCA, SCBCD)
I agree. Here's the link:
subject: help needed Regarding tree Structure
It's not a secret anymore!