ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 20th, 2005, 01:14 PM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
Looping over a CFoutput

At the livedocs it says that when you loop over a CFoutput the maxrows no longer works, and i'm running into that problem...I can't seem to come up with a fix for it either, anyone with any logical ideas?

Thanks
Caden

Reply With Quote
  #2  
Old May 20th, 2005, 01:52 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,682 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 15 h 42 m 54 sec
Reputation Power: 53
Are you sure? This doesn't mention anything about that:

http://livedocs.macromedia.com/cold...309.htm#1101659

But if it's really an issue, can't you just use a cfloop instead, keep track of a counter, and when you hit your limit just break out of the loop with cfbreak?
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #3  
Old May 20th, 2005, 02:38 PM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
check here

at the bottom of the page, it might just be some guy, and he mentions it in nested cfoutputs, but I think I still might be right...since it isn't working for me, but using a flag and cfbreak as you suggested worked fine.

Also, I figure if the guy was wrong, the macromedia team would have removed it from the page, I might be wrong.

Reply With Quote
  #4  
Old May 23rd, 2005, 09:58 AM
mlearn mlearn is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 13 mlearn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 58 m 12 sec
Reputation Power: 0
I have a somewhat strange and silly question... when would you want to use maxrows on a cfoutput? I have used it in CFQuery, but why use it in cfoutput? I am just curious since I have never used maxrows in that tag...

Thanks for indulging in my lack of knowlege. But anyways, I agree with using a counter, I am used to other programming languages where that is needed or even using a cfloop with a from/to clause... Ok I will be quiet now...

-Matt
http://www.LearnFamily.com

Reply With Quote
  #5  
Old May 23rd, 2005, 11:13 AM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
Well, here is the code

<cfset jflag = 0>
<cfset result = #ArrayClear(result)#>
<cfset result = ArrayNew(1)>
<cfoutput query="quote">
<cfset arrayAppend( result, quote.key )>
</cfoutput>
Quote:<br><br>
<cfset j = 0>
<cfloop from="1" to="#ArrayLen(result)#" index="j">
<cfquery datasource="numberonerule" name="every">
Select ID, Name, Quote, Category, Topic
From Quote
where id = #result[j]#
</cfquery>
<cfif jflag eq 3>
<cfbreak>
<cfelse>
<cfoutput query="every">
<span class="maintext">
<cfset jflag = jflag +1>
Name: #Name#<br>
Quote: #quote#<br><br>

</span>
</cfoutput>
</cfif>
</cfloop>

The problem is this...I have 3 verity collections, and when I did a search inside of that collection everything works. But I wanted to orginize the data under 3 headings...

The problem is, when you do a search and then use the "key" function you pull the ID of the record that you pulled, but there was no way I found that I could take that number and toss it into a query, and the only way I could see that number was inside an output so I felt the best way to go about that would be to loop over the output using an array to store the ID taking the ID everytime the output itself loops to dish out more information and throw it into a query.

Kiteless in Kiteless' infinate wisdom then came along and helped me out with that until we have what you see above which works perfectly.

So, now I can do a search, hit 3 verity collections and toss the results into the proper spot they fit, as an example, the database has the fields, name, category and topic...if you search for "bill" and it is found in any of thoes fields it will display now under the headings on the page...

so...

Name
result
result

Category
result

Topic
result
result
result

or whatever...sorry if that explanation sucks...but, follow me?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Looping over a CFoutput


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT