Write it using DHTML. I have written a few things that sound similar to what you are trying to achieve all using DHTML.
Populate your divs using jstl and style them nicely using css. Write a few simple reusable javascript functions to show/hide the divs and you are away. If you need any more help etc mail me off list. Chris -----Original Message----- From: Christian Bollmeyer [mailto:[EMAIL PROTECTED] Sent: 13 February 2004 21:08 To: Struts Users Mailing List Subject: Re: corporate hierarchy On Friday 13 February 2004 19:59, sean jones wrote: > Is there any struts tricks or tips that would help > > display an orgranizational tree > > i have a 17 level tree that i want to represent as a tree > on a jsp page. i want to use "+", "-" images to expand and > collapse the tree. > > is there a java class avalable to do this also. > > anyone any ideas. This depends on the amount of data to be displayed and the level of responsiveness you want. If we're really talking about a *17 level* thing here, first check if you really want to confront the user with such a beast. Not only that it will clutter up the entire screen, the user will inevitably get dizzy and feel lost beyond - let's say - subnodes at level 7 or 8, at the maximum. Then, most of them will call the support line, and the really wicked ones may finally send Evil Clowns after you or whatever. In such cases, it's better to provide a wizard or something else to avoid such infavorable circumstances. That said, some things coming instantly to my mind when it comes to Trees; there are several other implemenations around: 1. You can use the <nested> tags and use recursion. As was said, there is a fine manual on Arron Bates's website (www.keyboardmonkey.com) explaining everything step-by-step. The advantage of this is that you understand things after you completed the tutorial, plus you have your own, 'home-built' tree you can refine later on. This is proba- bly what I would choose if I had to do a TreeView in Struts. 2. There's a project around named <struts-layout> which, among other things, provides a TreeView control, among other things. Check out http://struts.application-servers.com/doc/tags/treeview.html to find out more. Don't know if it can handle 17 levels as well, but what they provide looks promising. Never got wise from their license policy terms for commercial applications, though, so I never looked further into this. 3. Find a Javascript implementation and populate it via Struts and JSP. JavaScript has the advantage of being really responsive (serverside tree implementations always require a roundtrip to the server upon each click, and the entire page has to be rebuilt), but it's not always available on the client and a major pain in the *** if I were asked. I avoid it where I can, but it definitely has its advantages. Note that if you choose this approach, you have to initially populate *everything* when building the Tree, but it will be faster afterwards. Still don't know if JavaScript can handle 17 levels. But you can always 'reuse' the icons, at least. Presenting a 'plus' sign, therefore, should be considered as one of your lowest-priority problems. > Thanks Sean Just my 2 cents, and HTH, -- Chris. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] *********************************************** This e-mail and its attachments are confidential and are intended for the above named recipient only. If this has come to you in error, please notify the sender immediately and delete this e-mail from your system. You must take no action based on this, nor must you copy or disclose it or any part of its contents to any person or organisation. Statements and opinions contained in this email may not necessarily represent those of Littlewoods. Please note that e-mail communications may be monitored. The registered office of Littlewoods Limited and its subsidiaries is 100 Old Hall Street, Liverpool, L70 1AB. Registered number of Littlewoods Limited is 262152. ************************************************ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]