tracker issue : CF-3194043

select a category, or use search below
(searches all categories and all time range)

New order attribute for query loops

| View in Tracker

Status/Resolution/Reason: To Fix//

Reporter/Name(from Bugbase): David McGuigan / David McGuigan (David McGuigan)

Created: 05/18/2012

Components: Language, Tags

Versions: 10.0

Failure Type: Enhancement Request

Found In Build/Fixed In Build: Final /

Priority/Frequency: Trivial / Unknown

Locale/System: English / Win All

Vote Count: 2

A great addition to query loops would be the ability to pass an order attribute in to avoid having to prepare/manipulate/mutate the source query  ( such as with a query of queries ) just to render it in a different order.

<cfparam name="url.order" default="ln" />
<cfloop query="qUsers" order="#url.order#">
    <!--- Etc. -->

So passing in an order attribute to a query loop would make ColdFusion create and sort a temporary copy of the query ( or more performantly:  an independent collection of keys and values which it would sort and then use as a translation key during the iteration to pull from the origin query itself in the correct order ) according to the input ( ideally it’d support a comma delimited list of column names but even just 1 column would already provide some serious efficiency assuming this was reasonably performant ) and then use that temporary, sorted query as the loop provider instead of the original.

Related thread:

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3194043

External Customer Info:
External Company:  
External Customer Name: David Michael McGuigan
External Customer Email:



+1. This is a good idea, and whilst this functionality can be achieved with a QoQ, this is a slick way of doing this. -- Adam
Vote by External U.
19406 | May 21, 2012 02:12:40 AM GMT
+1, currently I do QoQ but would much prefer this shortcut. IMO this suggested combination of cfloop/QoQ is like the combination of cfdump/cfabort (<cfdump abort=""). They make sense together, IMO.
Vote by External U.
19407 | May 21, 2012 08:07:49 PM GMT