Yaaaaarp, that's been around for a while. You're using the fix everyone else
does.

Adrian

-----Original Message-----
From: Andy Matthews [mailto:[EMAIL PROTECTED]
Sent: 23 February 2007 16:37
To: CF-Talk
Subject: Question about looping and the first row in a column


I'm sure that other people have run into this, but I'm baffled as to why
this is happening. I have a query in the variables scope
(VARIABLES.GetThisNavigationLocation). I'm looping over this query just like
you would normally. Then, inside that loop, I'm looping over another query
(VARIABLES.getChangeFrequencies) to build a dynamic dropdown. So for each
row in GetThisNavigationLocation, there's a dropdown containing every row in
getChangeFrequencies.

The problem is that inside the dropdown loop, the cfif seems to be using the
value from the very first row in the outer query in it's comparison which
results in every dropdown showing the same value, even though when I dump
the outer query, the values are clearly different.
<cfloop query="VARIABLES.getChangeFrequencies">
<option value="#VARIABLES.getChangeFrequencies.ID#" <cfif
VARIABLES.GetThisNavigationLocation.changefreq EQ
VARIABLES.getChangeFrequencies.ID>selected</cfif>>#VARIABLES.getChangeFreque
ncies.DisplayName#</option>
</cfloop>

The weird thing comes when I set a temp variable just outside the dropdown
loop like so:
<cfset tempFreq = VARIABLES.GetThisNavigationLocation.changefreq>

When I use that code, and compare to "tempFreq", the code works just fine.
Why is this happening? Does anyone have wisdom on this because it's really
irritating for me to have to have this extra line of code in here. Anyone?

____________________________________

Andy Matthews


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 by AdobeĀ®
Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. 
Free Trial. http://www.adobe.com/products/coldfusion

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:270584
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to