This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Struts and the fly likes Expandable Tree Structure in Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Expandable Tree Structure in Struts" Watch "Expandable Tree Structure in Struts" New topic

Expandable Tree Structure in Struts

Dhananjay Inamdar
Ranch Hand

Joined: Jan 27, 2003
Posts: 130
I wnat to create a collapsible/expandable tree structure using Struts in my jsp page.

How to achieve this. I am using struts 1.2.9 version.

I need a "+" sign with each parent, clicking on which the tree will collpase, "+" sign chnaging to "-" sign and show all the child nodes.The child nodes in turn will behave similar if they have any child nodes.

Thanks in advance!


Just like you, struggeling to get the right solutions!<br /> <br />Sun Certified Java Programmer 1.5<br /> <br />Target - SCWCD
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63542

Moved to the Struts forum.

[Asking smart questions] [About Bear] [Books by Bear]
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I'd suggest using one of the many JavaScript tree widgets that are available. I use trees quite often in my applications, and I have downloaded and modified TreeView for this purpose. There are lots of them, though. Just Google "JavaScript tree" and you'll get an idea of what's out there.

If you have a Java data model you wish to represent as a tree structure, just write a code generator class to generate the JavaScript code that will create the tree.
[ September 27, 2006: Message edited by: Merrill Higginson ]

Consultant, Sima Solutions
It is sorta covered in the JavaRanch Style Guide.
subject: Expandable Tree Structure in Struts
jQuery in Action, 3rd edition