Link to home
Start Free TrialLog in
Avatar of herkulis
herkulis

asked on

link that depends on link

How can one display a hierarchy similar to an organization chart in which clicking on a link inside a textbox#1 will display its children link(s) inside textbox#2 and clicking on a link inside textbox#2 will display its children link(s) inside textbox#3, and so forth?  
...
user clicks on "MotherOfAllLinks", the textbox#1 will show

<%
for (Iterator firstLevels = firstLevelList.Iterator();firstLevels.hasNext;) {
FirstLevel firstLevel = (FirstLevel)firstLevels.next();
%>
<a href="<%=[what should I put in here?]"><%=firstLevel.getChildren()%>
<%}%>
....

I was thinking of something like "secondLevel.getChildren(selectedFirstLevelLink)" but "selectedFirstLevelLink" is created at runtime and I do not know how to store it. Pleaes help! Thank you in advance.



Avatar of TimYates
TimYates
Flag of United Kingdom of Great Britain and Northern Ireland image

I think you will need to build up multiple arrays so that javascript can just pick the one it wants...

OR!

Have 3 list boxes in a form

Put javascript into the onClick event on each, so that it posts the form

Then in the JSP, get the selected values from the lists, and fill in the possibilities for the next list along...
Avatar of herkulis
herkulis

ASKER

Tim,
  Could you give some code examples? Thanks
ASKER CERTIFIED SOLUTION
Avatar of TimYates
TimYates
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It's not 100% right...but you should see what I'm getting at :-)
Tim,

  That looked very good to me so far:) Can you make the list boxes scrollable in case there are alot of data? Also, can you make a 'master' hyperlink that would populate the first box? Thanks alot.
Tim,

  I figured out the rest. Thank you very much. Happy Thanksgiving!
Could the administrator give me back 60points which I mistakenly added? Thank you
You need to post here:  https://www.experts-exchange.com/Community_Support/ to get your 60 points back (just post a Q for 0 points asking) :-)

Good luck with it all :-)

Glad I could help :-)

Tim