Further Greetings,
So, thanking those who did respond to my original posting concerning
sorting search results,
This is what I ended up doing. Not elegant or very pretty but here goes:
The problem: Search results produced by a dynamic query:
<CFQUERY DATASOURCE="db" NAME="getcontact">
SELECT
Contact_Information.First_Name,
Contact_Information.Last_Name,
Contact_Information.Organization_Name,
Contact_Information.Contact_ID,
Contact_Information.City,
Contact_Information.County
FROM Contact_Information
WHERE 1=0
<CFIF IsDefined('FORM.First_Name')>
<CFIF #First_Name# IS NOT "">
OR First_Name = '#FORM.First_Name#'
</CFIF>
</CFIF>
<!---snip--->
<CFIF IsDefined('FORM.County')>
<CFIF #FORM.County# IS NOT "">
OR County = '#FORM.County#'
</CFIF>
</CFIF>
<CFIF IsDefined('getid.Contact_ID')>
<CFIF #getid.Contact_ID# IS NOT "">
OR Contact_ID IN (#PreserveSingleQuotes(idList)#)
</CFIF>
</CFIF>
ORDER BY "#OrderBy#"
</CFQUERY>
How to sort these by the variables in the query:
In the results page the contacts are displayed tabularly with the <th>
headings</th>
a button with the heading name: ie: First Name, Last Name, City, etc.
<table border="1" width="100%">
<tr>
<th width="15%">
<CFOUTPUT>
<FORM ACTION="contsearch.cfm" METHOD="POST">
<INPUT TYPE="hidden" NAME="First_name" VALUE="#form.First_Name#">
<INPUT TYPE="hidden" NAME="Last_name" VALUE="#form.Last_Name#">
<INPUT TYPE="hidden" NAME="Organization_name"
VALUE="#Organization_Name#">
<INPUT TYPE="hidden" NAME="City" VALUE="#City#">
<INPUT TYPE="hidden" NAME="Zip_Code" VALUE="#Zip_Code#">
<INPUT TYPE="hidden" NAME="County" VALUE="#County#">
<INPUT TYPE="hidden" NAME="Contact_ID"
VALUE="#PreserveSingleQuotes(idList)#">
<INPUT TYPE="hidden" NAME="OrderBy" VALUE="First_Name">
<INPUT TYPE="hidden" NAME="Classification_Code"
VALUE="#Classification_Code#">
<INPUT TYPE="SUBMIT" VALUE="First Name">
</FORM>
</CFOUTPUT>
</th>
Each belonging to a form which passes the query variables as hidden fields
plus #OrderBy# as First Name, Last Name, City, etc.
Works like a charm but not as pretty as sending everything along via WDDX,
I guess.
Would still be interested if someone had a niftier way...
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.