User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ColdFusion section within the Web Development category of DaniWeb, a massive community of 428,581 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,688 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ColdFusion advertiser: Programming Forums
Views: 1821 | Replies: 3
Reply
Join Date: Mar 2007
Posts: 3
Reputation: digi3e is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
digi3e digi3e is offline Offline
Newbie Poster

Help Need help with n-tier looping

  #1  
Mar 31st, 2007
Hello anybody who takes the time to read this!

I am not new to CFM but have not hit it to deep as of this point. Here is my problem and I hope I can explain this well enough.

I have a page that will be driven left to right based on a parent/child relationship. The problem I have is figuring out how to loop indefinitely since my record set could contain a parent with a single child with no children or it could go 100 levels deep. So in reality, I basically want to make a tree like view that starts with 2 parents (USA and CANADA). Now "I" know that those both have children in my data structure (The query returns ID,ParentID and NAME. When I click on USA I need to see all 50 states in a new table cell to the right of it. Then when I click on a state, I need to see all of it's counties... then when I click on a county I need to see all of it's children which could be cities, agencies, city governmets etc...

All of these clicks I speak of will be post backs and no javascript or hidden divs since I need to make this little app accessible for the blind.

Also, if I have USA exapanded m-levels deep I need to be able to close it at any of the nodes. I also need to be able to click on CANADA and keep all the USA nodes open. So I need to figure out a way to track what's open and how it's connected etc so that I can export out the diagram in a PDF.

PLEASE HELP!!!!
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2007
Posts: 3
Reputation: digi3e is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
digi3e digi3e is offline Offline
Newbie Poster

Re: Need help with n-tier looping

  #2  
Mar 31st, 2007
I have a mock image if that helps.
http://www.stungi.com/mock.jpg
Reply With Quote  
Join Date: Jan 2007
Location: Austin, TX
Posts: 30
Reputation: Memento is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Memento Memento is offline Offline
Light Poster

Re: Need help with n-tier looping

  #3  
Apr 6th, 2007
Goal is something like:



World > United States > North East > New York >list of cities

Hidden form fields for:
Country
Region
State
City

Your CFM page checks if the hidden form fields have a value, if they do, it will add them to whatever query you have to pull the information. The result of that query is what you display on the page. If you write the query so that the same column can return either a state/region/city depending on your inputs then you should be good to go.

It seems like a lot of it relies on how you have this information structured in your database.



Good luck,
Dan
Dan Moore
www.danmoore.org
Reply With Quote  
Join Date: Mar 2007
Posts: 3
Reputation: digi3e is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
digi3e digi3e is offline Offline
Newbie Poster

Re: Need help with n-tier looping

  #4  
Apr 6th, 2007
Thanks, this issue has been resolved!!

I wrote a custom tag that is called within itself to deal with the n-level loop. Works slick!

Thanks all who viewed and esp Dan for replying!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ColdFusion Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ColdFusion Forum

All times are GMT -4. The time now is 11:29 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC