I want to build a message board which will list all messages, and list the
replies associated with that message if you click on that message in this
format:

*message
-----
*message (click here to view notes, this sends parameter to notes query)
*all notes for this message once parameter has been sent to notes query
-----
*next message
*next message

If you click on a different message, it hides the notes for the first
message and shows the notes for the new message selected.  I've got it set
up, so the parameter is being sent to the query and it is outputting the
notes for the message selected only, but it is showing them in this format:

*message
*message (this one is clicked)
*message
*message
*notes for clicked message at bottom of list instead of under the one
clicked.

I tried setting the record count of the first query to be the control of the
loop containing the message query and the notes query WHERE
messageid=notekey, but since I can't output the notes query inside the
message query, it does not work.

I've included the code of the page below.
I would  GREATLY appreciate if anyone could tell me what I'm missing on
this!

Thank you very much,
Britta

<cfparam name="shownotes" default="0">

<cfquery name="rmobcurrent" datasource="dave" dbtype="ODBC">
SELECT StoreID, ObjectiveID, ObjectiveTitle, ObjectiveDetails,
TargetCompletionDate, ActualCompletionDate, CompletionNotes,
Dependant, [E-MailSent],MoveToHistory, RemoveFromPalm, Initiator,
DateStamp, ObjectiveID, DateStamp, UserID
FROM RMObjectives
WHERE (MoveToHistory = 0)
</cfquery>

<cfset rmobcurrentcount = #rmobcurrent.RecordCount#>

<cfquery name="rmnotecurrent" datasource="dave" dbtype="ODBC">
SELECT ObjectiveID, RMObNoteID, DateStamp, UserID, UserType, ObjectiveType,
Note
FROM RMObjectiveNotes
WHERE (ObjectiveID = #shownotes#)
</cfquery>


<html>
<head>
 <title>View RM Objectives</title>
</head>

<body>

<table border="1" align="center">
<cfloop index="count" from="1" to="#ListLen(rmobcurrentcount)#">

<cfoutput query="rmobcurrent"><!--- output of first query which has message
info--->

<tr bgcolor="Gray">
<td>#DateStamp#</td>
<td colspan="4">#ObjectiveTitle#</td>
<td>ID:#ObjectiveID#</td>
</tr>

<td>Initiator: #Initiator#&nbsp;</td>
<td>#UserID#&nbsp;</td>
<td>#DateFormat(TargetCompletionDate)#&nbsp;</td>
<td>#DateFormat(ActualCompletionDate)#&nbsp;</td>
<td>
<form action="viewob.cfm" method="post">
<input type="Hidden" name="shownotes" value="#ObjectiveID#">
<input type="Submit" value="Show Notes">
</form>

</td>
<td>History#MoveToHistory#</td>
</tr>
<tr><td colspan="6">ObjectiveDetails: #ObjectiveDetails#&nbsp;</td></tr>
<tr><td colspan="6">CompletionNotes: #CompletionNotes#&nbsp;</td></tr>
</cfoutput>



<cfoutput query="rmnotecurrent"><!--- output of second query that has notes
info for the message selected.  I'd really like it to be included in the
loop of the message it relates to, but it won't let me nest the
queries.----------->
<tr>
<td>#DateStamp#</td>
<td>#UserID#</td>
<td>#UserType#</td>
<td>#Note#</td>
</tr>
</cfoutput>


</cfloop>
</table>



------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
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.

Reply via email to