This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Struts and the fly likes Displaying a tree? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Displaying a tree?" Watch "Displaying a tree?" New topic
Author

Displaying a tree?

Pat Peg
Ranch Hand

Joined: Feb 04, 2005
Posts: 194
I am tasked with building an application using struts where the end user would input data and as that data is being inputted, a tree structure would be built and displayed on the data entry page. I have thought about scrubbing the entire struts part and doing a swing application but I am not sure if this would be permissible. Has anyone who would like to share your experiences done this before?
I was thinking generally along these lines; the data entered could be sent back on submit to the database. Perhaps in the database, along with storing the information, I could somehow store the structure of the tree and return it to be displayed? Any thoughts?

Thanks
Pat Peg
Ranch Hand

Joined: Feb 04, 2005
Posts: 194
I realized I needed to refine things a bit. The data would actually be displayed more like a file system (yes, I know this is a tree as well). Didn't know if that added to the problem or not.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I've used trees extensively in my applications. What I have done is download one of the open source (or nearly open source) javascript tree controls. The two I have experience with are xTree by WebFX (http://webfx.eae.net/dhtml/xtree/implementation.html) and treeView (http://www.treeview.net/). These tree controls allow the user to expand and contract nodes just as they would on Windows Explorer.

I have then written code that will generate the appropriate javaScript statements that will produce the tree that I want displayed.

There are also tree controls in other frameworks such as JSF and struts-menu.


Merrill
Consultant, Sima Solutions
 
jQuery in Action, 2nd edition
 
subject: Displaying a tree?