My question in brief: if I have several documents that have the same DocumentPublicationDate, or the same DocumentTitle, then how can I get ColdFusion to sort them with alternating background colors?
1. Here's my current problem, which I have been reviewing for much of today. gdemaria, _agx_, Brichsoft, and other experts have helped me with this application to display CEP documents. Currently I am trying to group records in a readable, user-friendly list using alternating white and gray backgrounds. But my pages do not consistenly display orderly, alternating background colors.
2. I will give an example. Take a look at this page:
You will see that, instead of the expected alternating background colors, that (at the beginning) there are two white backgrounds slumped together. Then the alternating background colors proceed as expected.
3. I believe I know why the problem occurs. The default sort order for these pages is:
D.DocumentPublicationDate DESC, D.DocumentTitle, D.DocumentID, F.FileName
You will note that, on this page, three records all have the same DocumentPublicationDate: June 30, 2010. So, when ColdFusion tries to sort by DocumentPublicationDate, it must "sort" three records with the same DocumentPublicationDate. This causes the conflation of background colors -- I am fairly confident of this.
4. In a similar way, when I sort documents (or records) by Title, then documents that start with "School" get lumped together, causing further conflation of background colors.
5. Hmmm. How can I fix this? I need to tell ColdFusion to distinguish among database records that often have the same characteristics: same publication date; or same first word in their titles.
6. I organize records using the CFOUTPUT GROUP attribute and the CurrentRow MOD 2 IS 1 function:
<cfif CurrentRow MOD 2 IS 1>
... that is straightforward.
7. Here is the query that I use to query the database for documents that have files marked "isPressRelease" ... if a document has a file that is a press release, then the press release file shows up on the Press Releases page:
<!--- query getDocumentsandFiles: select columns from tables tbl_CEP_Documents D, tbl_CEP_Document_Topic T, tbl_Document_Has_Topic H, tbl_CEP_files F --->
<!--- to display CEP Document Title, Author, Abstract, Publication Date; and CEP Files associated with those documents; and download links to those files --->
FROM tbl_CEP_Documents D, tbl_CEP_Document_Topic T, tbl_Document_Has_Topic H, tbl_CEP_files F
WHERE D.DocumentID = H.DocumentID
AND D.DocumentID = F.DocumentID
AND F.IsPressRelease = 1
ORDER BY D.DocumentPublicationDate DESC, D.DocumentTitle, D.DocumentID, F.FileName
My question: if I have several documents that have the same DocumentPublicationDate, or the same DocumentTitle, then how can I get ColdFusion to sort them with alternating background colors?
I hope this question is lucid. Thank you for your help.