tracker issue : CF-3194043

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

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. -->
</cfloop>

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: https://prerelease.adobe.com/project/forum/thread.html?cap=312e16f64a924954a37d2c59405cd5d7&forid=%7B3cc76ab3-86bc-449c-a786-35b229e07030%7D&topid=%7B9e98c6c6-c6f1-467a-ba3b-d4e55cd6f1cd%7D&tp=1

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

Watson Bug ID:	3194043

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

Attachments:

Comments:

+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