You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by sean jones <se...@ubs.com> on 2004/02/13 19:59:26 UTC

corporate hierarchy

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. 

Thanks Sean


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: corporate hierarchy

Posted by Christian Bollmeyer <ja...@christianbollmeyer.de>.
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: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: corporate hierarchy

Posted by Tim Kettering <ti...@vivakos.com>.
I've had good success using the javascript functionality found at 

www.treeview.net  - it works with every browser I've tested, and is
pretty customizable.  And it cost me $30 for commercial use, so its
definitely a lot cheaper than investing developer time into a homegrown
solution.

Two slight problems I've run into - JSP tags don't support indeterminate
depth looping, so 
I have to do the tree to string processing for the javascript arrays on
the java side, which forces me to mix logic w/ html (unless someone here
can offer some thing I haven't thought of yet).

The other problem is that the so-called "author support by email" you
get when purchasing a license is next to useless.  The author will
respond, but in all of my cases, it's been something along the lines of
"Oh I'm not sure, try looking at the online examples, and see what you
can do."  Its almost as if he didn't write the source himself.

-tim 

-----Original Message-----
From: news [mailto:news@sea.gmane.org] On Behalf Of sean jones
Sent: Friday, February 13, 2004 1:59 PM
To: struts-user@jakarta.apache.org
Subject: corporate hierarchy


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. 

Thanks Sean


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: corporate hierarchy

Posted by Jeff Kyser <kt...@comcast.net>.
Recursion via the nested tags works grand - for the
best code samples and a tutorial to boot, go to
www.keyboardmonkey.com

its all standard struts stuff...

-jeff

On Friday, February 13, 2004, at 12:59  PM, 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.
>
> Thanks Sean
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org