RE: CFLOOP: Select Form in Edit Mode with Multiple Selections (selected help)
What about just using the ListFind function. ListFind(yourlist,currentid) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, March 30, 2006 10:43 PM To: CF-Talk Subject: CFLOOP: Select Form in Edit Mode with Multiple Selections (selected help) All, I'm trying to populate a (categories) select form with element in edit mode. I'm trying to loop through the entire list of categories while highlighting (selected) the categories associated within this recordset. I'm having a hard time getting multiple selections to siaply properly in edit mode. Each category_id is comma delimted. SAMPLE: SELECT * FROM press_rel WHERE press_re_id = #FORM.pre_existing# SELECT * FROM categories selected>#cat_name#< /option> Thanks. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:236669 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: CFLOOP: Select Form in Edit Mode with Multiple Selections (selected help)
is the problem I think. The column in the query won't be automatically expanded to a list - I'd use a query-based cfloop instead. On 3/31/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > All, > > I'm trying to populate a (categories) select form with element in edit mode. > I'm > trying to loop through the entire list of categories while highlighting > (selected) the > categories associated within this recordset. I'm having a hard time getting > multiple selections to siaply properly in edit mode. Each category_id is comma > delimted. > > SAMPLE: > > > cachedWithin = "#CreateTimeSpan(0, 0, 5, 0)#"> > SELECT * > FROM press_rel > WHERE press_re_id = #FORM.pre_existing# > > > > > SELECT * FROM categories > > > > > > > index = "ListElement" list = "#Edit_Get_Selected_PressRel.pre_cat_id#"> ListElement IS > GetCategoriesOutput.categorie_id>selected>#cat_name# > > -- CFAJAX docs and other useful articles: http://jr-holmes.coldfusionjournal.com/ ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:236661 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
CFLOOP: Select Form in Edit Mode with Multiple Selections (selected help)
All, I'm trying to populate a (categories) select form with element in edit mode. I'm trying to loop through the entire list of categories while highlighting (selected) the categories associated within this recordset. I'm having a hard time getting multiple selections to siaply properly in edit mode. Each category_id is comma delimted. SAMPLE: SELECT * FROM press_rel WHERE press_re_id = #FORM.pre_existing# SELECT * FROM categories selected>#cat_name# Thanks. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:236656 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: CFLOOP in Edit Mode - Invalid CFML construct
>>If you do a in your custom tags then you could do the /> method with them. Just what I mean: you have to do something. -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234919 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: CFLOOP in Edit Mode - Invalid CFML construct
If you do a in your custom tags then you could do the /> method with them. Although maybe there are times that could not be done, can not honestly think of a time but I am sure there are some. We use a system here that uses a ton of custom tags and unfortunately it is just second nature for me to type /> so I would find myself constantly backspacing through my code, finally just ended up adding the cfexit tag. I have had to do a few XHTML classes, so it has become a hard habbit for me to break when I type out tags, but I doubt many of the things I write would pass the XHTML verification tools. On 3/9/06, Claude Schneegans <[EMAIL PROTECTED]> wrote: > > >>It is valid XHTML > > Ah ok. > Personnally, I'll use XHTML when I'll need to, for the time being, > I prefer having all CFML and HTML tags and attributes in upper case, > and all variables and the rest of the code in lower case, question of > readibility, > but of course it is personal. > Closing unnecessary tags also creates trouble with custom tags executed > twice, > so I prefer not using it at all. > One would say that you don't have to apply XHTML rules to CF tags, but > that would > be even more confusing. > > -- > ___ > REUSE CODE! Use custom tags; > See http://www.contentbox.com/claude/customtags/tagstore.cfm > (Please send any spam to this address: [EMAIL PROTECTED]) > Thanks. > > > ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234905 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: CFLOOP in Edit Mode - Invalid CFML construct
>>It is valid XHTML Ah ok. Personnally, I'll use XHTML when I'll need to, for the time being, I prefer having all CFML and HTML tags and attributes in upper case, and all variables and the rest of the code in lower case, question of readibility, but of course it is personal. Closing unnecessary tags also creates trouble with custom tags executed twice, so I prefer not using it at all. One would say that you don't have to apply XHTML rules to CF tags, but that would be even more confusing. -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234904 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: CFLOOP in Edit Mode - Invalid CFML construct
It is valid XHTML(or maybe it was part of the HTML 4.0 spec), actually all upper case like that would not be if I remember correctly. It was more or less a joke on my part although it would be a good habbit for anyone to be in. Especially if they were ever to have to write code for things such as cell phones. You are not supposed to have attributes that do not equal anything just like you are supposed to always have closing tags such as and when no closing tag available you end it with a " /" such as On 3/9/06, Claude Schneegans <[EMAIL PROTECTED]> wrote: > > >>Even better GetCategoriesOutput.categorie_id>selected="selected" > > Sorry, I don't see the point here? Is legal > in HTML? Even if yes, what is the advantage? > > Anyway, the whole loop could be optimized: > Instead of > > > 682 : ISDEFINED ("pre_existing")> "#Edit_Get_Selected_PressRel.pre_cat_id#"> #GetCategoriesOutput.categorie_id#>selected>#cat_name# > 683 : > > Try > > ISDEFINED ("pre_existing") AND > listFind(Edit_Get_Selected_PressRel.pre_cat_id, categorie_id)> > selected>#cat_name# > > > ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234899 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: CFLOOP in Edit Mode - Invalid CFML construct
>>Even better selected="selected" Sorry, I don't see the point here? Is legal in HTML? Even if yes, what is the advantage? Anyway, the whole loop could be optimized: Instead of 682 : selected>#cat_name# 683 : Try selected>#cat_name# -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234896 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: CFLOOP in Edit Mode - Invalid CFML construct
Even better selected="selected" ;) On 3/9/06, Claude Schneegans <[EMAIL PROTECTED]> wrote: > > >> BAD: #GetCategoriesOutput.categorie_id#>selected > > >> GOOD: #GetCategoriesOutput.categorie_id#>selected > > BETTER: GetCategoriesOutput.categorie_id>selected > :-) > > -- > ___ > REUSE CODE! Use custom tags; > See http://www.contentbox.com/claude/customtags/tagstore.cfm > (Please send any spam to this address: [EMAIL PROTECTED]) > Thanks. > > > ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234888 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: CFLOOP in Edit Mode - Invalid CFML construct
>> BAD: selected >> GOOD: selected BETTER: selected :-) -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234880 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
RE: CFLOOP in Edit Mode - Invalid CFML construct
-Original Message- From: Alan Rother [mailto:[EMAIL PROTECTED] Sent: 09 March 2006 17:34 To: CF-Talk Subject: Re: CFLOOP in Edit Mode - Invalid CFML construct BAD: selected GOOD: selected BETTER: selected In if statement is CF you have to use IS, EQ, NEQ =] -- Alan Rother Macromedia Certified Advanced ColdFusion MX 7 Developer ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234860 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: CFLOOP in Edit Mode - Invalid CFML construct
Looks like you have an "=" sign instead of "IS" in the code below. That ain't gonna fly in CF. -- Josh - Original Message - From: <[EMAIL PROTECTED]> To: "CF-Talk" Sent: Thursday, March 09, 2006 8:12 AM Subject: CFLOOP in Edit Mode - Invalid CFML construct > Hi, I'm stuck on this and could use some help. > > I'm trying to populate a multiple selection form "in edit" > mode and highlight (selected) items that are stored with > the record. I'm storing the multiple selections in a single > VarChar column using a comma delimiter. > > Thanks > > CF***ERRORMESSAGE > Invalid CFML construct found on line 682 at column 196. > The error occurred in > D:\Inetpub\wwwroot\fuelcellmagazine.com\wwwroot\admin_fcm\Press_Releases\press.cfm: > > line 682 > > 680 : > 681 : > 682 : ISDEFINED ("pre_existing")> "#Edit_Get_Selected_PressRel.pre_cat_id#"> #GetCategoriesOutput.categorie_id#>selected>#cat_name# > 683 : > 684 : > CF***ERRORMESSAGE > > ***ACTUAL*CF***CODE** > cachedWithin = "#CreateTimeSpan(0, 0, 5, 0)#"> > SELECT * > FROM press_rel > WHERE press_re_id = 5 > > > > > SELECT * FROM fuelcellmagazine.categories > > > > > > > "#Edit_Get_Selected_PressRel.pre_cat_id#"> > selected > > >#cat_name# > > > ***ACTUAL*CF***CODE** > > ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234859 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: CFLOOP in Edit Mode - Invalid CFML construct
Oh yeah, You don't need the pound signs either. selected -- Alan Rother Macromedia Certified Advanced ColdFusion MX 7 Developer ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234855 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: CFLOOP in Edit Mode - Invalid CFML construct
BAD: selected GOOD: selected In if statement is CF you have to use IS, EQ, NEQ =] -- Alan Rother Macromedia Certified Advanced ColdFusion MX 7 Developer ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234854 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
CFLOOP in Edit Mode - Invalid CFML construct
Hi, I'm stuck on this and could use some help. I'm trying to populate a multiple selection form "in edit" mode and highlight (selected) items that are stored with the record. I'm storing the multiple selections in a single VarChar column using a comma delimiter. Thanks CF***ERRORMESSAGE Invalid CFML construct found on line 682 at column 196. The error occurred in D:\Inetpub\wwwroot\fuelcellmagazine.com\wwwroot\admin_fcm\Press_Releases\press.cfm: line 682 680 : 681 : 682 : selected>#cat_name# 683 : 684 : CF***ERRORMESSAGE ***ACTUAL*CF***CODE** SELECT * FROM press_rel WHERE press_re_id = 5 SELECT * FROM fuelcellmagazine.categories selected >#cat_name# ***ACTUAL*CF***CODE** ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234846 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Query of Queries and GROUP - use CFLOOP?
At 10:37 AM 3/4/2006, Jochem van Dieten wrote: > > > > Regarding the CFOUTPUT GROUP issue with query of queries, is it > > feasible to convert the output below to cfloop's? > > > > >Something like: > > > > Thanks, I was trying loops with the query parameter instead. I'll try your code and report back. Thanks again, Roberto ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234188 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Query of Queries and GROUP - use CFLOOP?
Roberto Perez wrote: > > Regarding the CFOUTPUT GROUP issue with query of queries, is it > feasible to convert the output below to cfloop's? What I have is: > > (cfouptut group=region) > > Region 1 > (cfoutput group=city) > City1 > (cfoutput) > client1 > client2 > City2 > client3 > client4 > Region 2 > > and so on. Something like: #groupcol1[i]# #groupcol2[i]# #ungroupedcol[i]# Jochem ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234186 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Query of Queries and GROUP - use CFLOOP?
Hi, Regarding the CFOUTPUT GROUP issue with query of queries, is it feasible to convert the output below to cfloop's? What I have is: (cfouptut group=region) Region 1 (cfoutput group=city) City1 (cfoutput) client1 client2 City2 client3 client4 Region 2 and so on. Since the GROUP parameter since to conflict with the query of queries (see previous message for details), can I achieve the same output with a CFLOOP tag? I tried a few combinations, but the output does not reflect the DB content (e.g., columns get grouped/merged incorrectly). Any pointers/ideas welcome. Regards, Roberto ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234183 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop query="" bug?
But thats not the case. The current row is correct, even in the inner loop, but the value is not. On 3/3/06, Claude Schneegans <[EMAIL PROTECTED]> wrote: > I think this issue has been discussed a few days before. > It is a bug in CF (not in blue Dragon). > The current row of a first level loop is alway on when seen from an > inner loop. > The workaround is to store column values in variables at the first level. > > -- > ___ > REUSE CODE! Use custom tags; > See http://www.contentbox.com/claude/customtags/tagstore.cfm > (Please send any spam to this address: [EMAIL PROTECTED]) > Thanks. > > > ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234062 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop query="" bug?
>>The current row of a first level loop is alway on Scuse, I meant is always ONE -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234052 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop query="" bug?
I think this issue has been discussed a few days before. It is a bug in CF (not in blue Dragon). The current row of a first level loop is alway on when seen from an inner loop. The workaround is to store column values in variables at the first level. -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234047 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
cfloop query="" bug?
Hey guys, im posting this to see if anyone else sees this as a bug. I have had a few people verify that Im not losing my mind, but just want to see if everyone agrees that this is not expected behavior. Take the following code and run it: start code Outside Loop:=, Inside Loop: =, end code You should see two query dumps, and then some output in text at the bottom. If you look at the code, you will see that on the inner loop, it pulls the correct currentRow from the outer loop, but not the correct value. The value, inside of the inner loop is always a, even though the currentRow changes. A workaround is to use #variables.queryOne.colA[variables.queryOne.currentRow]# in the inside loop, or, to use for the inner loop, but can we agree that you should not need to do either of those? Can we agree that with the code above, the expected output would be: Outside Loop: a = 1 , Inside Loop: a = 1 , a = 1 , a = 1 , a = 1 , a = 1 , Outside Loop: b = 2 , Inside Loop: b = 2 , b = 2 , b = 2 , b = 2 , b = 2 , Outside Loop: c = 3 , Inside Loop: c = 3 , c = 3 , c = 3 , c = 3 , c = 3 , Outside Loop: d = 4 , Inside Loop: d = 4 , d = 4 , d = 4 , d = 4 , d = 4 , Outside Loop: e = 5 , Inside Loop: e = 5 , e = 5 , e = 5 , e = 5 , e = 5 , What do you just think? -- Ryan Guill BlueEyesDevelopment [EMAIL PROTECTED] www.ryanguill.com (270) 217.2399 got google talk? Chat me at [EMAIL PROTECTED] The Coldfusion Open Application Library - COAL - http://coal.ryanguill.com Use CF and SQL? Try qBrowser - http://www.ryanguill.com/docs/ www.ryanguill.com/ The Roman Empire: www.ryanguill.com/blog/ ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234042 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop vs cfquery
Will Tomlinson wrote: > > This is the only chat room I've ever seen where you hafta enter your messages > via your login name. lol!! > It's fixed Will! You can get on with life now! Yay! ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233495 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop vs cfquery
Will Tomlinson wrote: > I ain't got all night. lol! It's past my bedtime. me neither.. it's a javascript error in the cfajax engine.js but I don't know why it started happening. Oh well, I'll figger it out eventually. Rick ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233493 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop vs cfquery
>I noticed =) I think ther's some kinda of javascript error.. gimme a >few minutes =) This is the only chat room I've ever seen where you hafta enter your messages via your login name. lol!! I've been using these as logins tonight: Hey Guys! Wow, this is a cool chat room! Rick, when will you fix the chat? Go away disruptor! ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233492 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop vs cfquery
I ain't got all night. lol! It's past my bedtime. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233490 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop vs cfquery
I noticed =) I think ther's some kinda of javascript error.. gimme a few minutes =) Will Tomlinson wrote: > And it's definitely rabid tonight. Keeps refreshing whenever I send in some > text. > > ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233489 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop vs cfquery
And it's definitely rabid tonight. Keeps refreshing whenever I send in some text. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233487 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop vs cfquery
I'm in your RabidAJAXChat... where are ya dude? Will ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233486 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop vs cfquery
Most of the time I use cfoutput, but if I'm concerned about whitespace output and I'm inside a cfsetting enablecfoutputonly="yes", I'll use cfloop and then place cfoutput tags only around what I want to output. Rick ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233485 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop vs cfquery
i ask because I just see some of the "better" coders using loop and of course I undestand that if you are outputing variables in the middle cfquery is a "doh" but say if you are using enableoutputonly then sticking page code between outputs its a null point, unless u wanna group something. Just something that pops in my head when i do it and was just curious. ~Dave the disruptor~ From: "Aaron Rouse" <[EMAIL PROTECTED]> Sent: Saturday, February 25, 2006 11:30 PM To: CF-Talk Subject: Re: cfloop vs cfquery If I need to actually output something from the query and I am not already in a cfoutput block then I do cfoutput with the query attribute. I do not think there is a "better" way, more to what is your preference. I work with some people who do something like this query="blah">#somethingfromquery# and to me that just seems like wasted typing. On 2/25/06, dave wrote: > > a ? i have always wondered is which is "better" to you when outputting a > query? > > For example, is it better to do this > > > > > > > > /buck/large/1.jpg > copyright Buck Forester > /buck/thumbs/1.jpg > > > > > > > or this > > > > > > > > /buck/large/1.jpg > copyright Buck Forester > /buck/thumbs/1.jpg > > > > > > > ~Dave the disruptor~ > > > > ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233484 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop vs cfquery
Erf, I hit send before reading what I typed, last closing tag should be not On 2/25/06, Aaron Rouse <[EMAIL PROTECTED]> wrote: > > If I need to actually output something from the query and I am not already > in a cfoutput block then I do cfoutput with the query attribute. I do not > think there is a "better" way, more to what is your preference. I work with > some people who do something like this query="blah">#somethingfromquery# and to me > that just seems like wasted typing. > > On 2/25/06, dave <[EMAIL PROTECTED]> wrote: > > > > a ? i have always wondered is which is "better" to you when outputting a > > query? > > > > For example, is it better to do this > > > > > > > > > > > > > > > > /buck/large/1.jpg > > copyright Buck Forester > > /buck/thumbs/1.jpg > > > > > > > > > > > > > > or this > > > > > > > > > > > > > > > > /buck/large/1.jpg > > copyright Buck Forester > > /buck/thumbs/1.jpg > > > > > > > > > > > > > > ~Dave the disruptor~ > > > > > > > > ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233483 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop vs cfquery
If I need to actually output something from the query and I am not already in a cfoutput block then I do cfoutput with the query attribute. I do not think there is a "better" way, more to what is your preference. I work with some people who do something like this #somethingfromquery# and to me that just seems like wasted typing. On 2/25/06, dave <[EMAIL PROTECTED]> wrote: > > a ? i have always wondered is which is "better" to you when outputting a > query? > > For example, is it better to do this > > > > > > > > /buck/large/1.jpg > copyright Buck Forester > /buck/thumbs/1.jpg > > > > > > > or this > > > > > > > > /buck/large/1.jpg > copyright Buck Forester > /buck/thumbs/1.jpg > > > > > > > ~Dave the disruptor~ > > > > ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233482 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
cfloop vs cfquery
a ? i have always wondered is which is "better" to you when outputting a query? For example, is it better to do this /buck/large/1.jpg copyright Buck Forester /buck/thumbs/1.jpg or this /buck/large/1.jpg copyright Buck Forester /buck/thumbs/1.jpg ~Dave the disruptor~ ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233481 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop over a query inside cfoutput over a query
Have to forgive me my mind is not working too great today(getting over the flu) but why would it not work? Seems to display correctly using this sample data: I have two volunteers for the first person who has one degree then three volunteers for the second person who has one degree then the last person has two degrees and two volunteers. Although I guess as I type that out something is not lining up right since I would imagine a volunteer relates to more than just the person. qry1 = queryNew("ENTITYID,FULLNAME,ZIP,DEGREE,VOLUNTID,VOLUNTNAME"); queryAddRow(qry1,1); querySetCell(qry1,"ENTITYID","123450"); querySetCell(qry1,"FULLNAME","John A. Doe"); querySetCell(qry1,"ZIP","48169"); querySetCell(qry1,"DEGREE","BS"); querySetCell(qry1,"VOLUNTID","janedoe1"); querySetCell(qry1,"VOLUNTNAME","Jane A. Doe"); queryAddRow(qry1,1); querySetCell(qry1,"ENTITYID","123450"); querySetCell(qry1,"FULLNAME","John A. Doe"); querySetCell(qry1,"ZIP","48169"); querySetCell(qry1,"DEGREE","BS"); querySetCell(qry1,"VOLUNTID","janedoe2"); querySetCell(qry1,"VOLUNTNAME","Jane B. Doe"); queryAddRow(qry1,1); querySetCell(qry1,"ENTITYID","123451"); querySetCell(qry1,"FULLNAME","John B. Doe"); querySetCell(qry1,"ZIP","27502"); querySetCell(qry1,"DEGREE","BA"); querySetCell(qry1,"VOLUNTID","janedoe3"); querySetCell(qry1,"VOLUNTNAME","Jane C. Doe"); queryAddRow(qry1,1); querySetCell(qry1,"ENTITYID","123451"); querySetCell(qry1,"FULLNAME","John B. Doe"); querySetCell(qry1,"ZIP","27502"); querySetCell(qry1,"DEGREE","BA"); querySetCell(qry1,"VOLUNTID","janedoe4"); querySetCell(qry1,"VOLUNTNAME","Jane D. Doe"); queryAddRow(qry1,1); querySetCell(qry1,"ENTITYID","123451"); querySetCell(qry1,"FULLNAME","John B. Doe"); querySetCell(qry1,"ZIP","27502"); querySetCell(qry1,"DEGREE","BA"); querySetCell(qry1,"VOLUNTID","janedoe5"); querySetCell(qry1,"VOLUNTNAME","Jane E. Doe"); queryAddRow(qry1,1); querySetCell(qry1,"ENTITYID","123450"); querySetCell(qry1,"FULLNAME","John C. Doe"); querySetCell(qry1,"ZIP","48169"); querySetCell(qry1,"DEGREE","BS"); querySetCell(qry1,"VOLUNTID","janedoe1"); querySetCell(qry1,"VOLUNTNAME","Jane A. Doe"); queryAddRow(qry1,1); querySetCell(qry1,"ENTITYID","123450"); querySetCell(qry1,"FULLNAME","John C. Doe"); querySetCell(qry1,"ZIP","48169"); querySetCell(qry1,"DEGREE","AA"); querySetCell(qry1,"VOLUNTID","janedoe2"); querySetCell(qry1,"VOLUNTNAME","Jane B. Doe"); #ENTITYID# #FULLNAME# #ZIP# Degrees: #DEGREE# Volunteer: #ENTITYID# #VOLUNTID# #VOLUNTNAME# On 2/22/06, Rick Root <[EMAIL PROTECTED]> wrote: > > > > Can't do that in my case, because I'm already grouping over OTHER data - > the degrees. That's why I had to go the route that I did. > > Rick > > ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233150 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
RE: cfloop over a query inside cfoutput over a query
Ian Skinner wrote: > IIRC CF is going to automatically scope to the nearest query. To > override this you will need to fully scope the variable. when I tried scoping it using getRosters.ENTITYID, it *ALWAYS* returned the same entity id - the first one. It only works if I assign it to a different variable. The solution was given in an earlier post. To use the complete, fully qualified query scope, which is queryName.columname[rowNumber]. So this "fob bar #getRoster.EntityID[currentRow]#" should get what you want. It is important to note that using and are just short cuts to the full query scope. This allows one to usually just access the data by column name. When one goes beyond the basics though, falling back to the full scoping will usually resolve the issue. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - "C code. C code run. Run code run. Please!" - Cynthia Dunning ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233149 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop over a query inside cfoutput over a query
Aaron Rouse wrote: > True, although ultimately my workaround would be to just pull out all the > data in one query and group over the entity ID then group over the volunteer > information. Can't do that in my case, because I'm already grouping over OTHER data - the degrees. That's why I had to go the route that I did. Rick ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233148 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop over a query inside cfoutput over a query
>>by adding the currentrow to the variable call This is it: The currentRow variable contains the right value, but the row by default in an expression is not set to currenRow, but to one. -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233146 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
RE: cfloop over a query inside cfoutput over a query
>okay good, so I wasn't going crazy. CF can't reference variables in the >current row of a a parent query loop from within a nested query loop >(but Bluedragon can) Inside of another query, CF will treat the variable as simple string--much like it would outside a cfloop query loop. There's 2 ways around this: 1) set a local variable before getting into the loop 2) use the query.currentRow to specify the position in the query. This is the way CF has behaved for as long as I can remember. I usually use #2 to do what I want: #myQuery.column[myQuery.currentRow]# -Dan ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233145 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop over a query inside cfoutput over a query
>>but it behaves as I think it *SHOULD* on Bluedragon 6.2 JX (on Linux) IMHO this is clearly a bug in CF. I've noticed the same behaviour and I'm also assigning columns to temporary variables. It seems that CF retains only the deeper level query current row. Any reference to an outter query is made to row #1. Full scoping is also a security when having several loops in queries. -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233144 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop over a query inside cfoutput over a query
Rick, I ran into something like this myself not so long ago ans solved it by adding the currentrow to the variable call, as in foo bar #getRoster.ENTITYID[currentRow]# ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233143 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop over a query inside cfoutput over a query
True, although ultimately my workaround would be to just pull out all the data in one query and group over the entity ID then group over the volunteer information. On 2/22/06, Rick Root <[EMAIL PROTECTED]> wrote: > > Aaron Rouse wrote: > > Interesting, now wouldn't a simple enough fix be to just add entityID to > the > > output of volunteers since that query is built off the id anyway? > > That's called a "workaround" =) But yeah > > But what if, for some reason, you couldn't return the entityid in the > query? > > Clearly, the other workaround of reassigning it to a different variable > name. > > rick > > ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233140 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop over a query inside cfoutput over a query
Andy Matthews wrote: > 6.1 on Windows here Rick. Here's the output of the code you provided: okay good, so I wasn't going crazy. CF can't reference variables in the current row of a a parent query loop from within a nested query loop (but Bluedragon can) Good 'nuf for me.. Rick ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233139 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop over a query inside cfoutput over a query
It behaves as you described on 6.1 On 2/22/06, Rick Root <[EMAIL PROTECTED]> wrote: > > Wow, the sample code I just posted behaves as I describe in CFMX7 on > Linux and Windows see: http://www.opensourcecf.com/test.cfm > > but it behaves as I think it *SHOULD* on Bluedragon 6.2 JX (on Linux) > > http://www.bobguiney.com/test.cfm > > Could this be a bug in CF? > > I don't have access to a CFMX 6.1 machine anymore so I can't see how it > behaves there. > > Rick > > ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233137 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
RE: cfloop over a query inside cfoutput over a query
6.1 on Windows here Rick. Here's the output of the code you provided: 123450 John A. Doe 48169 Degrees: BS Volunteer: 123450 janedoe1 Jane A. Doe Volunteer: 123450 janedoe2 Jane B. Doe Volunteer: 123450 janedoe3 Jane C. Doe Volunteer: 123450 janedoe4 Jane D. Doe Volunteer: 123450 janedoe5 Jane E. Doe 123451 John B. Doe 27502 Degrees: BA Volunteer: 123450 janedoe1 Jane A. Doe Volunteer: 123450 janedoe2 Jane B. Doe Volunteer: 123450 janedoe3 Jane C. Doe Volunteer: 123450 janedoe4 Jane D. Doe Volunteer: 123450 janedoe5 Jane E. Doe 123452 John B. Doe 27502 Degrees: PhD. Volunteer: 123450 janedoe1 Jane A. Doe Volunteer: 123450 janedoe2 Jane B. Doe Volunteer: 123450 janedoe3 Jane C. Doe Volunteer: 123450 janedoe4 Jane D. Doe Volunteer: 123450 janedoe5 Jane E. Doe 123453 John C. Doe 90210 Degrees: BS Volunteer: 123450 janedoe1 Jane A. Doe Volunteer: 123450 janedoe2 Jane B. Doe Volunteer: 123450 janedoe3 Jane C. Doe Volunteer: 123450 janedoe4 Jane D. Doe Volunteer: 123450 janedoe5 Jane E. Doe 123454 John D. Doe 10101 Degrees: MS Volunteer: 123450 janedoe1 Jane A. Doe Volunteer: 123450 janedoe2 Jane B. Doe Volunteer: 123450 janedoe3 Jane C. Doe Volunteer: 123450 janedoe4 Jane D. Doe Volunteer: 123450 janedoe5 Jane E. Doe 123455 John E. Doe 48103 Degrees: JD Volunteer: 123450 janedoe1 Jane A. Doe Volunteer: 123450 janedoe2 Jane B. Doe Volunteer: 123450 janedoe3 Jane C. Doe Volunteer: 123450 janedoe4 Jane D. Doe Volunteer: 123450 janedoe5 Jane E. Doe ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233136 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop over a query inside cfoutput over a query
Aaron Rouse wrote: > Interesting, now wouldn't a simple enough fix be to just add entityID to the > output of volunteers since that query is built off the id anyway? That's called a "workaround" =) But yeah But what if, for some reason, you couldn't return the entityid in the query? Clearly, the other workaround of reassigning it to a different variable name. rick ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233135 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop over a query inside cfoutput over a query
Interesting, now wouldn't a simple enough fix be to just add entityID to the output of volunteers since that query is built off the id anyway? On 2/22/06, Rick Root <[EMAIL PROTECTED]> wrote: > > Aaron Rouse wrote: > > Strange, I code like that quite often and never have it return just the > > first instance. It would return a repeat though since it would be > inside an > > inner loop. So if getRosters has a record count of 5 and then each > > volunteers query has a record count of 4 you get displayed the same > entity > > ID 20 times? > > Yes. > > It's like if you did this: > > > select entityid, prmlname from entities > > #getRoster.entityid# > > Since you'rre not inside a query-based cfoutput, it outputs the value > from the first row. > > I think that's what's happening when it doesn't find entityid in the > innermost query.. it doesn't seem to realize that it's nested inside > another query.. > > Here's some example code that shows this: > > >qry1 = queryNew("ENTITYID,FULLNAME,ZIP,DEGREE"); >queryAddRow(qry1,1); >querySetCell(qry1,"ENTITYID","123450"); >querySetCell(qry1,"FULLNAME","John A. Doe"); >querySetCell(qry1,"ZIP","48169"); >querySetCell(qry1,"DEGREE","BS"); >queryAddRow(qry1,1); >querySetCell(qry1,"ENTITYID","123451"); >querySetCell(qry1,"FULLNAME","John B. Doe"); >querySetCell(qry1,"ZIP","27502"); >querySetCell(qry1,"DEGREE","BA"); >queryAddRow(qry1,1); >querySetCell(qry1,"ENTITYID","123452"); >querySetCell(qry1,"FULLNAME","John B. Doe"); >querySetCell(qry1,"ZIP","27502"); >querySetCell(qry1,"DEGREE","PhD."); >queryAddRow(qry1,1); >querySetCell(qry1,"ENTITYID","123453"); >querySetCell(qry1,"FULLNAME","John C. Doe"); >querySetCell(qry1,"ZIP","90210"); >querySetCell(qry1,"DEGREE","BS"); >queryAddRow(qry1,1); >querySetCell(qry1,"ENTITYID","123454"); >querySetCell(qry1,"FULLNAME","John D. Doe"); >querySetCell(qry1,"ZIP","10101"); >querySetCell(qry1,"DEGREE","MS"); >queryAddRow(qry1,1); >querySetCell(qry1,"ENTITYID","123455"); >querySetCell(qry1,"FULLNAME","John E. Doe"); >querySetCell(qry1,"ZIP","48103"); >querySetCell(qry1,"DEGREE","JD"); > >qry2 = queryNew("VOLUNTID,VOLUNTNAME"); >queryAddRow(qry2,1); >querySetCell(qry2,"VOLUNTID","janedoe1"); >querySetCell(qry2,"VOLUNTNAME","Jane A. Doe"); >queryAddRow(qry2,1); >querySetCell(qry2,"VOLUNTID","janedoe2"); >querySetCell(qry2,"VOLUNTNAME","Jane B. Doe"); >queryAddRow(qry2,1); >querySetCell(qry2,"VOLUNTID","janedoe3"); >querySetCell(qry2,"VOLUNTNAME","Jane C. Doe"); >queryAddRow(qry2,1); >querySetCell(qry2,"VOLUNTID","janedoe4"); >querySetCell(qry2,"VOLUNTNAME","Jane D. Doe"); >queryAddRow(qry2,1); >querySetCell(qry2,"VOLUNTID","janedoe5"); >querySetCell(qry2,"VOLUNTNAME","Jane E. Doe"); > > > > #ENTITYID# #FULLNAME# #ZIP# > Degrees: #DEGREE# > > >Volunteer: #qry1.ENTITYID# #VOLUNTID# #VOLUNTNAME# > > > > > ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233133 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop over a query inside cfoutput over a query
Wow, the sample code I just posted behaves as I describe in CFMX7 on Linux and Windows see: http://www.opensourcecf.com/test.cfm but it behaves as I think it *SHOULD* on Bluedragon 6.2 JX (on Linux) http://www.bobguiney.com/test.cfm Could this be a bug in CF? I don't have access to a CFMX 6.1 machine anymore so I can't see how it behaves there. Rick ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233132 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop over a query inside cfoutput over a query
Aaron Rouse wrote: > Strange, I code like that quite often and never have it return just the > first instance. It would return a repeat though since it would be inside an > inner loop. So if getRosters has a record count of 5 and then each > volunteers query has a record count of 4 you get displayed the same entity > ID 20 times? Yes. It's like if you did this: select entityid, prmlname from entities #getRoster.entityid# Since you'rre not inside a query-based cfoutput, it outputs the value from the first row. I think that's what's happening when it doesn't find entityid in the innermost query.. it doesn't seem to realize that it's nested inside another query.. Here's some example code that shows this: qry1 = queryNew("ENTITYID,FULLNAME,ZIP,DEGREE"); queryAddRow(qry1,1); querySetCell(qry1,"ENTITYID","123450"); querySetCell(qry1,"FULLNAME","John A. Doe"); querySetCell(qry1,"ZIP","48169"); querySetCell(qry1,"DEGREE","BS"); queryAddRow(qry1,1); querySetCell(qry1,"ENTITYID","123451"); querySetCell(qry1,"FULLNAME","John B. Doe"); querySetCell(qry1,"ZIP","27502"); querySetCell(qry1,"DEGREE","BA"); queryAddRow(qry1,1); querySetCell(qry1,"ENTITYID","123452"); querySetCell(qry1,"FULLNAME","John B. Doe"); querySetCell(qry1,"ZIP","27502"); querySetCell(qry1,"DEGREE","PhD."); queryAddRow(qry1,1); querySetCell(qry1,"ENTITYID","123453"); querySetCell(qry1,"FULLNAME","John C. Doe"); querySetCell(qry1,"ZIP","90210"); querySetCell(qry1,"DEGREE","BS"); queryAddRow(qry1,1); querySetCell(qry1,"ENTITYID","123454"); querySetCell(qry1,"FULLNAME","John D. Doe"); querySetCell(qry1,"ZIP","10101"); querySetCell(qry1,"DEGREE","MS"); queryAddRow(qry1,1); querySetCell(qry1,"ENTITYID","123455"); querySetCell(qry1,"FULLNAME","John E. Doe"); querySetCell(qry1,"ZIP","48103"); querySetCell(qry1,"DEGREE","JD"); qry2 = queryNew("VOLUNTID,VOLUNTNAME"); queryAddRow(qry2,1); querySetCell(qry2,"VOLUNTID","janedoe1"); querySetCell(qry2,"VOLUNTNAME","Jane A. Doe"); queryAddRow(qry2,1); querySetCell(qry2,"VOLUNTID","janedoe2"); querySetCell(qry2,"VOLUNTNAME","Jane B. Doe"); queryAddRow(qry2,1); querySetCell(qry2,"VOLUNTID","janedoe3"); querySetCell(qry2,"VOLUNTNAME","Jane C. Doe"); queryAddRow(qry2,1); querySetCell(qry2,"VOLUNTID","janedoe4"); querySetCell(qry2,"VOLUNTNAME","Jane D. Doe"); queryAddRow(qry2,1); querySetCell(qry2,"VOLUNTID","janedoe5"); querySetCell(qry2,"VOLUNTNAME","Jane E. Doe"); #ENTITYID# #FULLNAME# #ZIP# Degrees: #DEGREE# Volunteer: #qry1.ENTITYID# #VOLUNTID# #VOLUNTNAME# ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233130 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop over a query inside cfoutput over a query
Strange, I code like that quite often and never have it return just the first instance. It would return a repeat though since it would be inside an inner loop. So if getRosters has a record count of 5 and then each volunteers query has a record count of 4 you get displayed the same entity ID 20 times? On 2/22/06, Rick Root <[EMAIL PROTECTED]> wrote: > > Ian Skinner wrote: > > IIRC CF is going to automatically scope to the nearest query. To > override this you will need to fully scope the variable. > > when I tried scoping it using getRosters.ENTITYID, it *ALWAYS* returned > the same entity id - the first one. It only works if I assign it to a > different variable. > > > ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233126 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop over a query inside cfoutput over a query
Ian Skinner wrote: > IIRC CF is going to automatically scope to the nearest query. To override > this you will need to fully scope the variable. when I tried scoping it using getRosters.ENTITYID, it *ALWAYS* returned the same entity id - the first one. It only works if I assign it to a different variable. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233121 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop over a query inside cfoutput over a query
So the volunteers query does not contain the EntityID? It is only present in the getRoster query? If so then just scope it: getRoster.EntityID On 2/22/06, Rick Root <[EMAIL PROTECTED]> wrote: > > Consider the following code: > > > > > > > >foo bar #ENTITYID# > > > > The reference to ENTITYID inside the cfloop breaks, says it doesn't > exist. Is that because CF only looks at the current query being looped > over? > > It works fine if I add something like > just after the first cfoutput line and then reference *THAT* variable > instead. > > Just seems odd. > > Rick > > ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233113 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
RE: cfloop over a query inside cfoutput over a query
IIRC CF is going to automatically scope to the nearest query. To override this you will need to fully scope the variable. I suspect you want: foo bar #getRoster.ENTITYID# -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - "C code. C code run. Run code run. Please!" - Cynthia Dunning ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233112 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop over a query inside cfoutput over a query
I've had that same issue with nested queries, I think CF can only reference the innermost query. Others will probably have more info. Also, your cfoutputs are nested, is that ok in CF7? I think that would cause an error in earlier versions but seems to work in CF7. -- Josh - Original Message - From: "Rick Root" <[EMAIL PROTECTED]> To: "CF-Talk" Sent: Wednesday, February 22, 2006 9:16 AM Subject: cfloop over a query inside cfoutput over a query > Consider the following code: > > > > > > > > foo bar #ENTITYID# > > > > The reference to ENTITYID inside the cfloop breaks, says it doesn't > exist. Is that because CF only looks at the current query being looped > over? > > It works fine if I add something like > just after the first cfoutput line and then reference *THAT* variable > instead. > > Just seems odd. > > Rick > > ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233110 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
RE: cfloop over a query inside cfoutput over a query
This problem has existed since CF5 at least as far as I know. That is the workaround for it. thanks -r _ Rob Barthle Contractor - Sr. Software Developer [EMAIL PROTECTED] 202-245-6484 -Original Message- From: Rick Root [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 22, 2006 12:17 PM To: CF-Talk Subject: cfloop over a query inside cfoutput over a query Consider the following code: foo bar #ENTITYID# The reference to ENTITYID inside the cfloop breaks, says it doesn't exist. Is that because CF only looks at the current query being looped over? It works fine if I add something like just after the first cfoutput line and then reference *THAT* variable instead. Just seems odd. Rick ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233109 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop over a query inside cfoutput over a query
what about if you scope it as #volunteers.EntityID#? On 2/22/06, Rick Root <[EMAIL PROTECTED]> wrote: > Consider the following code: > > > > > > > > foo bar #ENTITYID# > > > > The reference to ENTITYID inside the cfloop breaks, says it doesn't > exist. Is that because CF only looks at the current query being looped > over? > > It works fine if I add something like > just after the first cfoutput line and then reference *THAT* variable > instead. > > Just seems odd. > > Rick > > ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233108 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
cfloop over a query inside cfoutput over a query
Consider the following code: foo bar #ENTITYID# The reference to ENTITYID inside the cfloop breaks, says it doesn't exist. Is that because CF only looks at the current query being looped over? It works fine if I add something like just after the first cfoutput line and then reference *THAT* variable instead. Just seems odd. Rick ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233106 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop vs cfoutput query - best practice
> Well that's okay then. But I was HOPING you'd tell me you had a way to group > using cfloop darnit! Well you can do it...but it's not that efficientrole your own code that keeps track of the LAST loops value of the field you want to group onwhen LAST value is not equal to current value you toss in a special bit of display code (like grouping using CFOUTPUT would)so say if the current department neq to last department...through in a departmnet title row. Brute force but it works fine ;-) Cheers Bryan Stevenson B.Comm. VP & Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: [EMAIL PROTECTED] web: www.electricedgesystems.com ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:227182 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
RE: cfloop vs cfoutput query - best practice
I meant having a built-in option for doing it, like with cfoutput. -Original Message- From: Adrian Lynch [mailto:[EMAIL PROTECTED] Sent: Friday, December 16, 2005 8:24 AM To: CF-Talk Subject: RE: cfloop vs cfoutput query - best practice Well you can, but you wouldn't want to. Just do the logic yourself by seeing if the grouping column has changed, if it has, you've moved onto the next group. Ade -Original Message- From: Andy Matthews [mailto:[EMAIL PROTECTED] Sent: 16 December 2005 14:13 To: CF-Talk Subject: RE: cfloop vs cfoutput query - best practice Well that's okay then. But I was HOPING you'd tell me you had a way to group using cfloop darnit! -Original Message- From: Bryan Stevenson [mailto:[EMAIL PROTECTED] Sent: Thursday, December 15, 2005 4:18 PM To: CF-Talk Subject: Re: cfloop vs cfoutput query - best practice > That's not possible. > > What if you want to group on a column? Cfloop can't do that, only cfoutput. > How do you get around that limitation? Because I would maim to be able to > use group with cfloop. Well yes it is possible if you never (at least not in about 5 years) use the grouping ability of CFOUTPUT ;-) never say never Andy ;-) Cheers Bryan Stevenson B.Comm. ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:227155 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
RE: cfloop vs cfoutput query - best practice
Well you can, but you wouldn't want to. Just do the logic yourself by seeing if the grouping column has changed, if it has, you've moved onto the next group. Ade -Original Message- From: Andy Matthews [mailto:[EMAIL PROTECTED] Sent: 16 December 2005 14:13 To: CF-Talk Subject: RE: cfloop vs cfoutput query - best practice Well that's okay then. But I was HOPING you'd tell me you had a way to group using cfloop darnit! -Original Message- From: Bryan Stevenson [mailto:[EMAIL PROTECTED] Sent: Thursday, December 15, 2005 4:18 PM To: CF-Talk Subject: Re: cfloop vs cfoutput query - best practice > That's not possible. > > What if you want to group on a column? Cfloop can't do that, only cfoutput. > How do you get around that limitation? Because I would maim to be able to > use group with cfloop. Well yes it is possible if you never (at least not in about 5 years) use the grouping ability of CFOUTPUT ;-) never say never Andy ;-) Cheers Bryan Stevenson B.Comm. ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:227154 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
RE: cfloop vs cfoutput query - best practice
Well that's okay then. But I was HOPING you'd tell me you had a way to group using cfloop darnit! -Original Message- From: Bryan Stevenson [mailto:[EMAIL PROTECTED] Sent: Thursday, December 15, 2005 4:18 PM To: CF-Talk Subject: Re: cfloop vs cfoutput query - best practice > That's not possible. > > What if you want to group on a column? Cfloop can't do that, only cfoutput. > How do you get around that limitation? Because I would maim to be able to > use group with cfloop. Well yes it is possible if you never (at least not in about 5 years) use the grouping ability of CFOUTPUT ;-) never say never Andy ;-) Cheers Bryan Stevenson B.Comm. ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:227151 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
RE: cfloop vs cfoutput query - best practice
I doubt you'll see a big performance hit either way. It would probably be mostly up to you and what you find easier to read/follow when looking at your code. Generally speaking though, most people would expect to have something displayed between tags and would probably use cfloop in this case. You could just turn on debugging and compare the execution times of both. ..:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Charlie Hanlon [mailto:[EMAIL PROTECTED] Sent: Thursday, December 15, 2005 4:20 PM To: CF-Talk Subject: cfloop vs cfoutput query - best practice First, thanks to all who communicate via cf_talk. I have learned alot about my trade from all of the contributors. While its a rare occurance, when I am able to provide insight regarding someone's inquiry, I do so. My question is, if I need to loop thru a query result set and will be not displaying the data, is it better practice/more efficient to use instead of ??? thanks in advance charlie hanlon developer food service enablers, inc. ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:227135 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop vs cfoutput query - best practice
> That's not possible. > > What if you want to group on a column? Cfloop can't do that, only cfoutput. > How do you get around that limitation? Because I would maim to be able to > use group with cfloop. Well yes it is possible if you never (at least not in about 5 years) use the grouping ability of CFOUTPUT ;-) never say never Andy ;-) Cheers Bryan Stevenson B.Comm. VP & Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: [EMAIL PROTECTED] web: www.electricedgesystems.com ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:227130 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
RE: cfloop vs cfoutput query - best practice
That's not possible. What if you want to group on a column? Cfloop can't do that, only cfoutput. How do you get around that limitation? Because I would maim to be able to use group with cfloop. -Original Message- From: Bryan Stevenson [mailto:[EMAIL PROTECTED] Sent: Thursday, December 15, 2005 3:59 PM To: CF-Talk Subject: Re: cfloop vs cfoutput query - best practice used to matternot anymore...if ya want the technical details I can fill them in for you...I use CFLOOP exclusively Bryan Stevenson B.Comm. VP & Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: [EMAIL PROTECTED] web: www.electricedgesystems.com ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:227128 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop vs cfoutput query - best practice
used to matternot anymore...if ya want the technical details I can fill them in for you...I use CFLOOP exclusively Bryan Stevenson B.Comm. VP & Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: [EMAIL PROTECTED] web: www.electricedgesystems.com ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:227126 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop vs cfoutput query - best practice
IIRC, it doesn't matter anymore in terms of speed with CF6+ As a matter of personal preference, if there's no output I use a loop. If there *is* output and I am using a loop I make sure I put the cfoutputs outside the loop, but again I don't believe that makes any difference unless you are on CF 5 or older. -- --mattRobertson-- Janitor, MSB Web Systems mysecretbase.com ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:227124 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop vs cfoutput query - best practice
I prefer CFLOOP for all my query looping needs (even when I'm outputting) assuming I don't need the grouping provided by CFOUTPUT. I don't know if it's more efficient, but I think it makes the code easier to read. cheers, barneyb On 12/15/05, Charlie Hanlon <[EMAIL PROTECTED]> wrote: > First, thanks to all who communicate via cf_talk. I have learned alot about > my trade from all of the contributors. While its a rare occurance, when I > am able to provide insight regarding someone's inquiry, I do so. > > My question is, if I need to loop thru a query result set and will be not > displaying the data, is it better practice/more efficient to use query=""> instead of ??? > > thanks in advance > > charlie hanlon -- Barney Boisvert [EMAIL PROTECTED] 360.319.6145 http://www.barneyb.com/ Got Gmail? I have 100 invites. ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:227123 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop vs cfoutput query - best practice
Here it is: http://coldfusion.sys-con.com/read/41568.htm Will ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:227122 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop vs cfoutput query - best practice
Ben Forta ran some tests on this one a while back, and I think it came out pretty even. You can probably google it and find his results. Will ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:227120 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
cfloop vs cfoutput query - best practice
First, thanks to all who communicate via cf_talk. I have learned alot about my trade from all of the contributors. While its a rare occurance, when I am able to provide insight regarding someone's inquiry, I do so. My question is, if I need to loop thru a query result set and will be not displaying the data, is it better practice/more efficient to use instead of ??? thanks in advance charlie hanlon developer food service enablers, inc. ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:227119 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Cfloop collection
Glad to help. :) > Thanks for helping me understand this correctly. > Mark s. isaac dealey 954.522.6080 new epoch : isn't it time for a change? add features without fixtures with the onTap open source framework http://www.fusiontap.com http://coldfusion.sys-con.com/author/4806Dealey.htm ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:205083 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Cfloop collection
Thanks for helping me understand this correctly. Mark -Original Message- From: S. Isaac Dealey [mailto:[EMAIL PROTECTED] Sent: Friday, April 29, 2005 9:35 AM To: CF-Talk Subject: Re: Cfloop collection > > > > - Select A Company collection="#SESSION.companyIDList#" > item="companyID"> >value="#SESSION.companyIDList.companyID#">#SESSION.company > IDList.companyName > # > > > Hi mark... The collection loop is much like an array loop, you still have to index the structure (unlike a query which automatically assumes [currentrow]). #session.companyIDList[companyid].companyName# Note that since you're setting the "item" companyid to the current structure key in the loop, and you've already assigned the keys to match the companyid it's not necessary to reference the content of the structure for the option value. hth s. isaac dealey 954.522.6080 new epoch : isn't it time for a change? add features without fixtures with the onTap open source framework http://www.fusiontap.com http://coldfusion.sys-con.com/author/4806Dealey.htm ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:205074 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Cfloop collection
Thanks, that worked. I'm not using the query directly in this instance as I need to pass the query to a different page for further processing. -Original Message- From: Pascal Peters [mailto:[EMAIL PROTECTED] Sent: Friday, April 29, 2005 9:32 AM To: CF-Talk Subject: RE: Cfloop collection #SESSION.companyIDList[companyID].companyName # But why don't you just use the query? Pascal > -Original Message- > From: Mark Leder [mailto:[EMAIL PROTECTED] > Sent: 29 April 2005 15:19 > To: CF-Talk > Subject: Cfloop collection > > Hi all, > I want to loop a structure and present the output in a form list select. > I'm able to put the query in a structure and dump it successfully, but the > cfloop collection code keeps throwing errors. How do I fix this? BTW: > each > companyID is a UUID string; the QueryToStructofStructures is from CFLib. > > > SESSION.companyIDList = > StructNew(); SESSION.companyIDList = > "#QueryToStructOfStructures(qCompanyRecords,"companyID")#"; > > > > > - Select A Company collection="#SESSION.companyIDList#" item="companyID"> > value="#SESSION.companyIDList.companyID#">#SESSION.companyIDList.company Na > me > # > > > > > > > > ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:205073 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Cfloop collection
> > > > - Select A Company >item="companyID"> >value="#SESSION.companyIDList.companyID#">#SESSION.company > IDList.companyName > # > > > Hi mark... The collection loop is much like an array loop, you still have to index the structure (unlike a query which automatically assumes [currentrow]). #session.companyIDList[companyid].companyName# Note that since you're setting the "item" companyid to the current structure key in the loop, and you've already assigned the keys to match the companyid it's not necessary to reference the content of the structure for the option value. hth s. isaac dealey 954.522.6080 new epoch : isn't it time for a change? add features without fixtures with the onTap open source framework http://www.fusiontap.com http://coldfusion.sys-con.com/author/4806Dealey.htm ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:205071 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Cfloop collection
#SESSION.companyIDList[companyID].companyName # But why don't you just use the query? Pascal > -Original Message- > From: Mark Leder [mailto:[EMAIL PROTECTED] > Sent: 29 April 2005 15:19 > To: CF-Talk > Subject: Cfloop collection > > Hi all, > I want to loop a structure and present the output in a form list select. > I'm able to put the query in a structure and dump it successfully, but the > cfloop collection code keeps throwing errors. How do I fix this? BTW: > each > companyID is a UUID string; the QueryToStructofStructures is from CFLib. > > > > SESSION.companyIDList = StructNew(); > SESSION.companyIDList = > "#QueryToStructOfStructures(qCompanyRecords,"companyID")#"; > > > > > - Select A Company > > value="#SESSION.companyIDList.companyID#">#SESSION.companyIDList.company Na > me > # > > > > > > > > ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:205069 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Cfloop collection
Hi all, I want to loop a structure and present the output in a form list select. I'm able to put the query in a structure and dump it successfully, but the cfloop collection code keeps throwing errors. How do I fix this? BTW: each companyID is a UUID string; the QueryToStructofStructures is from CFLib. SESSION.companyIDList = StructNew(); SESSION.companyIDList = "#QueryToStructOfStructures(qCompanyRecords,"companyID")#"; - Select A Company #SESSION.companyIDList.companyName # ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:205067 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Grouped output with cfloop?
I'd, first of all, select all the data I needed in one chunk. Nice, locally cached dataset, in RAM, speedy delivery. What happens from there is different based on your first query... is it ordered by your group-by value? If not, I'd do this: Run a query-of-queries to do a distinct select against the column I wanted to loop by. Then, I'd loop over that query using CFLOOP and for every iteration, I'd run a QofQ to select my data from the first query and loop that for output. I know, I know... performance, performance! Yeah, whatever. It's squeaky clean, readable, sensible code. The first query is locally cached and the subsequent queries could be written with CFQUERYPARAM with should enhance performance. If it is... I'd do what Mr. Dawson recommends... just loop over your query and use a cfif to detect whether the currentrow.column value is the same as your groupValue variable. If it's different, output the groupby value, update the variable, and keep looping. If it's the same, skip the group-by value and only output the data. The real question is WHY you wouldn't want to use the cfoutput groupby="" parameter... that's what it's there for. Laterz! J On Tue, 22 Mar 2005 09:53:36 -0500, Pete Ruckelshaus <[EMAIL PROTECTED]> wrote: > Is there any way to do grouped query output using cfloop? Reason is > that I use a switch/case statement for my page, and wrap the entire > thing in a cfoutput tag to make my code more readable. I would like > to do something like: > > > #groupcolumndata# > > #blah# > > > > But I would like to do it with cfloop or some other technique. Is > this possible? > > Thanks > > Pete > > ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:199732 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Grouped output with cfloop?
You could put your grouped output in a separate file and cfinclude it... -Brad - Original Message - From: "Pete Ruckelshaus" <[EMAIL PROTECTED]> To: "CF-Talk" Sent: Tuesday, March 22, 2005 9:53 AM Subject: Grouped output with cfloop? > Is there any way to do grouped query output using cfloop? Reason is > that I use a switch/case statement for my page, and wrap the entire > thing in a cfoutput tag to make my code more readable. I would like > to do something like: > > > #groupcolumndata# > > #blah# > > > > But I would like to do it with cfloop or some other technique. Is > this possible? > > Thanks > > Pete > > ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:199726 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Grouped output with cfloop?
Yes, it's possible, but you need a few extra variables to store the "current" grouped value and a CFIF tag or two. Basically, you need to store the first grouped value in a temp variable. If the next value is the same as what you stored, you don't output it. You keep doing this until you get to a different value. Then, you store that new value and display it. Rinse and repeat. I had to build a pretty complicated "grid" recently. I started with a simple array that held my base values, then, I took a few extra steps to add bits of information to that array in the proper locations. Once I had that array completely built, all I had to do was loop over it and simply output everything. Maybe something like that would make sense for you? M!ke -Original Message- From: Pete Ruckelshaus [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 22, 2005 8:54 AM To: CF-Talk Subject: Grouped output with cfloop? Is there any way to do grouped query output using cfloop? Reason is that I use a switch/case statement for my page, and wrap the entire thing in a cfoutput tag to make my code more readable. I would like to do something like: #groupcolumndata# #blah# But I would like to do it with cfloop or some other technique. Is this possible? Thanks Pete ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:199667 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Grouped output with cfloop?
Is there any way to do grouped query output using cfloop? Reason is that I use a switch/case statement for my page, and wrap the entire thing in a cfoutput tag to make my code more readable. I would like to do something like: #groupcolumndata# #blah# But I would like to do it with cfloop or some other technique. Is this possible? Thanks Pete ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:199665 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: CFLOOP COLLECTION looping in wrong order
Incidentally MX also introduced StructSort() which does the same thing for the collection loop because CF5 collection loops used to be sorted automatically and they figured this was the fix (I've never understood why they didn't just make this automatic in the cfloop tag for backward compatibility.) ... #myStruct[i]# > The order of a struct's elements is undefined. If you > want an ordered > collection, use an array. If you really need an ordered > struct (I'm > sure there's a legit reason somewhere), you'd have to make > some kind > of complex data type that combines a struct and an array. > Note that these two loops are equivalent: > > #myStruct[i]# > > > #myStruct[i]# > > The latter can have a listSort wrapped around the > structKeyList to > sort the keys which may or may not solve your problem, > depending on if > the desired key order can be expressed with an alphabetic > sort. > cheers, > barneyb > On Thu, 10 Mar 2005 14:33:02 -0500, Damien McKenna > <[EMAIL PROTECTED]> wrote: >> I've got a structure like so: >> >> Events[] >> "ARSG90IFNwcmluZ3M=7" >> "MITGFtYXI=3" >> "TXQXJsaW5ndG9u5" >> >> Yes, the elements are base64 encoded. >> >> Anyway, I do a dump of the structure before running it in >> cfloop and it >> is in the correct order that I want. Then I run this: >> >> >> stuff in here >> >> >> However the cfloop query outputs the data in a different >> order, putting >> the TX value first, then AR then MI. Is something going >> wrong or am I >> missing a step? >> >> Thanks. >> >> -- >> Damien McKenna - Web Developer - >> [EMAIL PROTECTED] > -- > Barney Boisvert > [EMAIL PROTECTED] > 360.319.6145 > http://www.barneyb.com/ > Got Gmail? I have 50 invites. > ~~ > ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:198255 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
RE: CFLOOP COLLECTION looping in wrong order
Thanks for that Barney. I did a search and found the same thing but it still listed everything in that weird order. I played around with some other things and finally found it, but for the life of me the change I made didn't seem to make sense that it would affect the sort order. Ah well, its working now. -- Damien McKenna - Web Developer - [EMAIL PROTECTED] The Limu Company - http://www.thelimucompany.com/ - 407-804-1014 #include ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:198254 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: CFLOOP COLLECTION looping in wrong order
The order of a struct's elements is undefined. If you want an ordered collection, use an array. If you really need an ordered struct (I'm sure there's a legit reason somewhere), you'd have to make some kind of complex data type that combines a struct and an array. Note that these two loops are equivalent: #myStruct[i]# #myStruct[i]# The latter can have a listSort wrapped around the structKeyList to sort the keys which may or may not solve your problem, depending on if the desired key order can be expressed with an alphabetic sort. cheers, barneyb On Thu, 10 Mar 2005 14:33:02 -0500, Damien McKenna <[EMAIL PROTECTED]> wrote: > I've got a structure like so: > > Events[] > "ARSG90IFNwcmluZ3M=7" > "MITGFtYXI=3" > "TXQXJsaW5ndG9u5" > > Yes, the elements are base64 encoded. > > Anyway, I do a dump of the structure before running it in cfloop and it > is in the correct order that I want. Then I run this: > > > stuff in here > > > However the cfloop query outputs the data in a different order, putting > the TX value first, then AR then MI. Is something going wrong or am I > missing a step? > > Thanks. > > -- > Damien McKenna - Web Developer - [EMAIL PROTECTED] -- Barney Boisvert [EMAIL PROTECTED] 360.319.6145 http://www.barneyb.com/ Got Gmail? I have 50 invites. ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:198247 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
CFLOOP COLLECTION looping in wrong order
I've got a structure like so: Events[] "ARSG90IFNwcmluZ3M=7" "MITGFtYXI=3" "TXQXJsaW5ndG9u5" Yes, the elements are base64 encoded. Anyway, I do a dump of the structure before running it in cfloop and it is in the correct order that I want. Then I run this: stuff in here However the cfloop query outputs the data in a different order, putting the TX value first, then AR then MI. Is something going wrong or am I missing a step? Thanks. -- Damien McKenna - Web Developer - [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> The Limu Company - http://www.thelimucompany.com/ <http://www.thelimucompany.com/> - 407-804-1014 #include ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:198246 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
RE: cfloop vs cfoutput mx 6.1 / 7
I choose based on my need. If the page already has cfoutput blocks, then I use cfloop, unless I need to group output and then I use cfoutput. On a new page, I typically choose cfloop... - Calvin -Original Message- From: Will Tomlinson [mailto:[EMAIL PROTECTED] Sent: Sunday, February 20, 2005 5:55 AM To: CF-Talk Subject: Re: cfloop vs cfoutput mx 6.1 / 7 >Can anyone tell me if there is a performance difference in the >following 2 bits of code? I know back in 4.5 cfloop was worse than >cfoutput but now? Any web references to tests on these things welcome! This is Forta on the subject. It's pre 6.1/7, but I'll bet it's the same. http://www.sys-con.com/coldfusion/article.cfm?id=568 Will ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:195737 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: cfloop vs cfoutput mx 6.1 / 7
>Can anyone tell me if there is a performance difference in the >following 2 bits of code? I know back in 4.5 cfloop was worse than >cfoutput but now? Any web references to tests on these things welcome! This is Forta on the subject. It's pre 6.1/7, but I'll bet it's the same. http://www.sys-con.com/coldfusion/article.cfm?id=568 Will ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:195631 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
cfloop vs cfoutput mx 6.1 / 7
Can anyone tell me if there is a performance difference in the following 2 bits of code? I know back in 4.5 cfloop was worse than cfoutput but now? Any web references to tests on these things welcome! Thanks. Duncan // using cfloop for the query output // select * from Products order by Family #getProducts.ProductName# // using cfoutput for the quey output // select * from Products order by Family #ProductName# ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:195618 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: CFLOOP not looping
Like I said Chrisyou need the IN clause...will work with single or multiple IDs passed in ;-) Bryan Stevenson B.Comm. VP & Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: [EMAIL PROTECTED] web: www.electricedgesystems.com ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192403 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: CFLOOP not looping
On Mon, 31 Jan 2005 19:25:36 +, Chris Kavanagh <[EMAIL PROTECTED]> wrote: > On 31 Jan 2005, at 7:12 pm, Charlie Griefer wrote: > > > are you sure your query is returning records? do a > > #get_people.recordcount# after your to > > make sure. > > Ah! Now we're getting somewhere. No: when I check multiple boxes on > the form that gets me here, it sends one value, like this: > > 1,7 > > Which begs the question: how do I make it send separate values? Then I > think my CFLOOP might work. see prior responses re: using IN instead of = -- Charlie Griefer Marta was watching the football game with me when she said, "You know, most of these sports are based on the idea of one group protecting its territory from invasion by another group." "Yeah," I said, trying not to laugh. Girls are funny. ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192401 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
SOLVED: CFLOOP not looping
:D it now loops. The IN clause fixed it. Thanks everybody. - ck. ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192399 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: CFLOOP not looping
On 31 Jan 2005, at 7:12 pm, Charlie Griefer wrote: > are you sure your query is returning records? do a > #get_people.recordcount# after your to > make sure. Ah! Now we're getting somewhere. No: when I check multiple boxes on the form that gets me here, it sends one value, like this: 1,7 Which begs the question: how do I make it send separate values? Then I think my CFLOOP might work. 1 7 -- SELECT projects.name AS projectname, projects.company AS projectcompany, people.person_id, people.name AS personname, people.company AS personcompany FROM projects JOIN people ON projects.company = people.company WHERE projects.project_id = #project_id# #personname# ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192397 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
RE: CFLOOP not looping
SELECT person_id FROM people WHERE person_id = '#Form.person_id#' This query is only going to return one record, assuming person_id is an unique key. I suspect what you may be wanting is a IN clause SELECT person_id FROM people WHERE person_id IN () HTH, otherwise we need to know more about #form.person_ID# and the people table. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA "C code. C code run. Run code run. Please!" - Cynthia Dunning ...-Original Message- ...From: Chris Kavanagh [mailto:[EMAIL PROTECTED] ...Sent: Monday, January 31, 2005 11:07 AM ...To: CF-Talk ...Subject: CFLOOP not looping ... ...Dear list, ... ...My CFLOOP doesn't seem to be looping my INSERTS. ... ...A form passes the variables #person_id# & #project_id# to this page: ... ... ... ... SELECT person_id FROM people ... WHERE person_id = '#Form.person_id#' ... ... ... ... ... ... ... INSERT INTO people_project (person_id, project_id) ... VALUES ('#Form.person_id#', '#Form.project_id#') ... ... ... ... ...-- ... ...When there are multiple #person_id#s, I was hoping the CFLOOP would ...create multiple rows in the table. But it doesn't. :/ What am I ...doing wrong this time? ... ...Many thanks, ...CK. ... ... ... ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192395 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: CFLOOP not looping
Your person_IDs var probably holds a list of IDs (or a single ID)so you need to use an IN cluse in your first SELECT to get multuple records to then use to loop over and do your inserts. like so: SELECT person_id FROM people WHERE person_id IN () INSERT INTO people_project (person_id, project_id) VALUES ('#person_id#', '#FORM.project_id#') Note the FORM scope was removed from Person_ID in the above query as you want the individual ID returned from "get_people", and NOT the LIST OF IDs that may be in FORM.person_ID HTH Cheers Bryan Stevenson B.Comm. VP & Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: [EMAIL PROTECTED] web: www.electricedgesystems.com ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192392 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: CFLOOP not looping
are you sure your query is returning records? do a #get_people.recordcount# after your to make sure. On Mon, 31 Jan 2005 19:07:13 +, Chris Kavanagh <[EMAIL PROTECTED]> wrote: > Dear list, > > My CFLOOP doesn't seem to be looping my INSERTS. > > A form passes the variables #person_id# & #project_id# to this page: > > > > SELECT person_id FROM people > WHERE person_id = '#Form.person_id#' > > > > > > > INSERT INTO people_project (person_id, project_id) > VALUES ('#Form.person_id#', '#Form.project_id#') > > > > > -- > > When there are multiple #person_id#s, I was hoping the CFLOOP would > create multiple rows in the table. But it doesn't. :/ What am I > doing wrong this time? > > Many thanks, > CK. > > ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192386 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
CFLOOP not looping
Dear list, My CFLOOP doesn't seem to be looping my INSERTS. A form passes the variables #person_id# & #project_id# to this page: SELECT person_id FROM people WHERE person_id = '#Form.person_id#' INSERT INTO people_project (person_id, project_id) VALUES ('#Form.person_id#', '#Form.project_id#') -- When there are multiple #person_id#s, I was hoping the CFLOOP would create multiple rows in the table. But it doesn't. :/ What am I doing wrong this time? Many thanks, CK. ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192384 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Attribute validation error for tag cfloop
You can't loop over the results of an insert query, because an insert query produces no results. You can only use CFLOOP with select queries. - Rick Chris Kavanagh wrote: > Dear list, > > I'm getting this error message: > > -- > Attribute validation error for tag cfloop. > The value of the attribute query, which is currently "insert_people", > is invalid. > -- > > I guess there's something wrong with my INSERT statement but I can't > figure out what it is. I've tried permutations for the VALUEs with "s, > 's, no quotes, double #s, but it still doesn't seem to work. > > Here's my code: > > -- > Taskomatic > > DELETE FROM people_project > WHERE project_id = '#project_id#' > > > > INSERT INTO people_project > VALUES ('#person_id#', '#project_id#') > > > > > Access list updated > > #person_id# > > > > > ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192372 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Attribute validation error for tag cfloop
Dear list, I'm getting this error message: -- Attribute validation error for tag cfloop. The value of the attribute query, which is currently "insert_people", is invalid. -- I guess there's something wrong with my INSERT statement but I can't figure out what it is. I've tried permutations for the VALUEs with "s, 's, no quotes, double #s, but it still doesn't seem to work. Here's my code: -- Taskomatic DELETE FROM people_project WHERE project_id = '#project_id#' INSERT INTO people_project VALUES ('#person_id#', '#project_id#') Access list updated #person_id# ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192365 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: odd.. cfoutput group and cfloop over query
Thanks for clarification... Did not find any posts.. matching my request.. so posted.. just a FYI.. nested loops over queries worked fine for me.. in MX6.1.. infact I still have 2 systems without the 6.1 updater applied.. on which I tested the code.. however I think this point has been discussed 101X on this list.. so there goes 102 times.. :-) -- Regards, Pascal Peters wrote: > This has always been like this (and must have been discussed a 100x on > this list). When you have nested loops over queries (it doesn't matter > if you are using cfoutput or cfloop), coldfusion looses the reference to > the first query when looping the second. This means that you can't drop > the prefix (which you shouldn't in the first place) and that > q1.currentRow will always return 1 (and q1.column will always return the > value from the first record. You have already found the solution for > that problem: set the value to a variable before the second loop. > > If you have a lot of fields from the first query to access in the second > loop, just save the currentRow in a variable and use array notation for > the first query. > > > > > > do something > > > > > Pascal > > >>-Original Message- >>From: Umer Farooq [mailto:[EMAIL PROTECTED] >>Sent: 10 December 2004 02:54 >>To: CF-Talk >>Subject: odd.. cfoutput group and cfloop over query >> >>Hi, >> >>I'm getting this odd.. problem.. when doing.. >> >> >> >> >> SOMETHING >> >> >> >> >>in the loop QUERYONE.XID will keep the first row value. >> >>if I remove the prefix from XID.. it gives me an error saying its >>not defined. Which is odd by itself. >> >>I can get away from the error by setting a variable.. before the >>loop and then compare on it.. >> >>Any thoughts on this.. > > > ~| Special thanks to the CF Community Suite Silver Sponsor - CFDynamics http://www.cfdynamics.com Message: http://www.houseoffusion.com/lists.cfm/link=i:4:187348 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
RE: odd.. cfoutput group and cfloop over query
This has always been like this (and must have been discussed a 100x on this list). When you have nested loops over queries (it doesn't matter if you are using cfoutput or cfloop), coldfusion looses the reference to the first query when looping the second. This means that you can't drop the prefix (which you shouldn't in the first place) and that q1.currentRow will always return 1 (and q1.column will always return the value from the first record. You have already found the solution for that problem: set the value to a variable before the second loop. If you have a lot of fields from the first query to access in the second loop, just save the currentRow in a variable and use array notation for the first query. do something Pascal > -Original Message- > From: Umer Farooq [mailto:[EMAIL PROTECTED] > Sent: 10 December 2004 02:54 > To: CF-Talk > Subject: odd.. cfoutput group and cfloop over query > > Hi, > > I'm getting this odd.. problem.. when doing.. > > > > > SOMETHING > > > > > in the loop QUERYONE.XID will keep the first row value. > > if I remove the prefix from XID.. it gives me an error saying its > not defined. Which is odd by itself. > > I can get away from the error by setting a variable.. before the > loop and then compare on it.. > > Any thoughts on this.. ~| Special thanks to the CF Community Suite Silver Sponsor - RUWebby http://www.ruwebby.com Message: http://www.houseoffusion.com/lists.cfm/link=i:4:186952 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
odd.. cfoutput group and cfloop over query
Hi, I'm getting this odd.. problem.. when doing.. SOMETHING in the loop QUERYONE.XID will keep the first row value. if I remove the prefix from XID.. it gives me an error saying its not defined. Which is odd by itself. I can get away from the error by setting a variable.. before the loop and then compare on it.. Any thoughts on this.. Regards, -- Umer Farooq Octadyne Systems [EMAIL PROTECTED] +1 (519) 772-5424 voice +1 (519) 635-2795 mobile +1 (208) 275-3824 fax LOOKING FOR A USED CAR IN IOWA VISIT: http://www.IowaMotors.com WARNING: --- The information contained in this document and attachments is confidential and intended only for the person(s) named above. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution, or any other use of the information is strictly prohibited. If you have received this document by mistake, please notify the sender immediately and destroy this document and attachments without making any copy of any kind. ~| Special thanks to the CF Community Suite Silver Sponsor - RUWebby http://www.ruwebby.com Message: http://www.houseoffusion.com/lists.cfm/link=i:4:186934 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54