Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Displaying a tree?

 
Pat Peg
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic