I have run into this in the past, but never asked anyone why it occurred or if
there is a better way of doing this.
If I have a CFLoop inside of a CFoutput and inside the CFLoop I call a variable
from the surrounding CFoutput query I get a blank.
I have to set the variable as a local variable in order to use it in the CFLoop.
Below does not work:
<cfoutput query="getPages">
<form action="">
<select name="Status">
<cfloop query="getPageStatusTypes">
<option <cfif getPageStatusTypes.PageStatus EQ
getPages.status>SELECTED</cfif>></option>
</cfloop>
</select>
</form>
</cfoutput>
Below DOES work:
<cfoutput query="getPages">
<cfset localstatus = getPages.status>
<form action="">
<select name="Status">
<cfloop query="getPageStatusTypes">
<option <cfif getPageStatusTypes.PageStatus EQ
variables.localstatus>SELECTED</cfif>></option>
</cfloop>
</select>
</form>
</cfoutput>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:259536
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4