Mulitple URL Variables in CFWINDOW - Destroy / Create

I have a page with a normal HTML table that has a CFLOOP populating it. I am needing to pass two URL variables through to a CFWINDOW which has another CFLOOP on it that is conditional based off the variables that are passed. Below is a snippet. I have it now where it is at least populating the CFWINDOW, but only with the first record, and it doesn't matter which link you click on as it always uses the first record, as opposed to the record ID of the link you click on.

I have to be able to pass both a project_id variable (which is already being passed through the URL) and a type= variable which is pulled from the ServicesQuery

Any and all help would be much appreciated.

<!--- Begin Sales & Services Scheduled Table ---->
<table width="945"> 
<tr bgcolor="#edeeef">
<td><font size="2"><b>Service</b></font></td>
<td><font size="2"><b>Number Of</b></font></td>
<td><font size="2"><b>Amount Per</b></font></td>
<td><font size="2"><b>Amount Total</b></font></td>
<td><font size="2"><b>Date(s) of Service</b></font></td>
<td><font size="2"><b>Consultant</a></b></font></td>
<td><font size="2"><b>SLA Signed?</a></b></font></td>
<td><font size="2"><b>Comments</b></font></td>
<td><font size="2"><center><b>Edit / Delete</b></center></font></td>
<cfset dark=false>
<cfloop query="ServicesQuery">
<cfquery datasource="#application.dsn#" name="getics">
		select emplid as icid, lastName, firstName, 'Staff' as status 
		from Employee
		where (emplid = '2' or emplid = '18' or emplid = '26' or emplid = '139' or emplid = '140')
		and status <> 'T'
		select icid, lastName, firstName, 'IC' as status 
		from independentContractor
		where status = 'A'
order by lastname, firstname
<tr <cfif dark is true>bgcolor="#edeeef"</cfif><cfoutput>>
<td>#dateformat(ServicesQuery.sched_date,"mm/dd/yy")# - #dateformat(ServicesQuery.endsched_date,"mm/dd/yy")#</td>
	<cfif ServicesQuery.employee_id gt 0>
	<cfquery datasource="#application.dsn#" name="getempname2">
	select firstname, lastname
	from employee
	where emplid = #ServicesQuery.employee_id#
	<td>#getempname2.firstname# #getempname2.lastname#</td>
	<cfelseif ServicesQuery.ic_id is 2 or ServicesQuery.ic_id is 18 or ServicesQuery.ic_id is 26 or ServicesQuery.ic_id is 139 or ServicesQuery.ic_id is 140>
	<cfquery datasource="#application.dsn#" name="getempname">
	select firstname, lastname
	from employee
	where emplid = #ServicesQuery.ic_id#
	<td>#getempname.firstname# #getempname.lastname#</td>
	<cfquery datasource="#application.dsn#" name="geticname">
	select firstname, lastname
	from independentcontractor
	where icid = '#ServicesQuery.ic_id#'
	<td>#geticname.firstname# #geticname.lastname#</td>
<td><a href="##" onclick="'servicesComments')">Comments</a></td>
<td><center><a href=""><img src="edit.gif" border="0" /></a>&nbsp;/&nbsp;<a href=""><img src="delete.gif" border="0" /></a></center></td>
<cfif dark is true><cfset dark=false><cfelse><cfset dark=true></cfif>
<cfwindow x="210" y="100" width="675" height="550" name="servicesComments" 
        refreshOnShow="true" modal="true" minHeight="550" minWidth="675" 
        title="Sales & Services Comment" initshow="false"
        source="servicescomments.cfm?project_id=#project_id#&type=#ServicesQuery.type#" />
<!---- Begin Sales & Services Input Form ---->
<cfform height="700" width="950" format="flash" skin="haloblue" name="salesandservices" wMode="transparent" method="post">
<cfformgroup type="panel" label="HR Solutions - Sales & Services Scheduling" style="color:##000000; fontSize:10; text-align: Left;">
<cfformgroup type="horizontal">
  	<cfselect name="type" width="175" label="     Service:"  tooltip="Please Select a Service" >        
<option value="" selected>Select a Service</option>
<cfif survey is 'eos'><option value="mk">Management Kickoff</option></cfif>
<cfif survey is 'eos' or survey is 'apulse' or survey is 'exit'><option value="sp">Survey Processing</option></cfif>
<cfif survey is 'eos' or survey is 'apulse' or survey is 'exit'><option value="projm">Project Maintenance</option></cfif>
<cfif survey is 'eos' or survey is 'apulse' or survey is 'exit'><option value="trans">Translations</option></cfif>
<cfif survey is 'eos' or survey is 'exit'><option value="sa">Survey Administration</option></cfif>
<cfif survey is 'eos' or survey is 'apulse' or survey is 'exit'><option value="bre">BRE's</option></cfif>
<cfif survey is 'eos' or survey is 'apulse' or survey is 'exit'><option value="packp">Package Preps</option></cfif>
<cfif survey is 'exit'><option value="phone">Phone Interviews</option></cfif>
<cfif survey is 'eos' or survey is 'exit'><option value="ac">Analysis</option></cfif>
<cfif survey is 'eos' or survey is 'apulse' or survey is 'exit'><option value="hd">History Data</option></cfif>
<cfif survey is 'eos' or survey is 'apulse' or survey is 'exit'><option value="rmfee">Report Modification Fee</option></cfif>
<cfif survey is 'eos' or survey is 'apulse' or survey is 'exit'><option value="cr">Customized Reports</option></cfif>
<cfif survey is 'eos' or survey is 'apulse' or survey is 'exit'><option value="apreport">ActionPro Reporting</option></cfif>
<cfif survey is 'eos' or survey is 'exit'><option value="ip">Initial Presentation</option></cfif>
<cfif survey is 'eos'><option value="f">Feedback</option></cfif>
<cfif survey is 'eos' or survey is 'exit'><option value="fr">Final Report</option></cfif>
<cfif survey is 'eos' or survey is 'exit'><option value="fp">Final Presentation</option></cfif>
<cfif survey is 'eos'><option value="aproap">ActionPro Action Planning</option></cfif>
<cfif survey is 'eos'><option value="aprot">ActionPro Training</option></cfif>
<cfif survey is 'eos'><option value="aplant">Action Plan Training</option></cfif>
<cfif survey is 'eos' or survey is 'apulse'><option value="aconday">Apulse Consulting Day</option></cfif>
	<cfinput name="num_days" size="6" type="text" label="Number Of:" tooltip="Please Enter Number of Days or Services" required="Yes" message="Number of Services/Days is Required" />        
    <cfinput name="amount_per" size="6" type="text" label="Amount Per:" tooltip="Please Enter Amount Per Day or Service" required="Yes" message="Amount Per Service/Day is Required"  />        
	<cfinput name="charge" size="6" type="text" label="Amount Total:" tooltip="Totals Automatically" required="Yes" message="Amount Total is Required" bind="{(num_days.text * 1) * (amount_per.text * 1)}" readonly/>        
<cfformgroup type="horizontal">
	<cfselect name="icid" width="175" label="Consultant:"  tooltip="Please add a Consultant" >        
			  <option value="">Select a Consultant</option>     
			  <cfloop query="getics">
 			  <option value="#getics.icid#">#getics.lastname#, #getics.firstname#</option>
<cfinput label="Start Date:" type="DateField" name="sched_date" width="150"  tooltip="Please Enter a Start Date">
<cfinput label="End Date:" type="DateField" name="endsched_date" width="150"  tooltip="Please Enter an End Date (optional)">
<cfinput label="SLA Signed?" type="checkbox" name="sla" tooltip="Check for Yes">
<cfformgroup type="panel" label="Comments:"  style="color:##000000; fontSize:12; text-align: Left;">
<cftextarea name="comments" rows="12"/>
<cfformgroup type="horizontal">
<cfformgroup type="horizontal">
	<cfformgroup type="horizontal">
        <cfinput name="submit" value="Submit" type="submit" label="Submit" />            
        <cfinput name="reset" value="Reset Form" type="reset" label="Reset Form" />

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AaronDittoAuthor Commented:
Attached is the query - and lines 60 and 70-73 are the window popup.
<cfquery datasource="#application.dsn#" name="ServicesQuery">
		FROM project_services
		INNER JOIN project_services_type on project_services.type=project_services_type.service_type
		where project_id = #project_id#
		order by service_order asc

Open in new window

AaronDittoAuthor Commented:
I'm also needing to know how to have the CFWINDOW destroy the last contents, and refresh with the new contents from a different link (ID)
AaronDittoAuthor Commented:
nevermind - figured it out

I added the CFWINDOW into the loop, structured the "name" of the window within the loop to have a UNIQUE name by adding "name="#ServicesQuery.sched_id#-Comments" into the CFWINDOW tag, and for LINE 60 :

<a href="##" onclick="'#ServicesQuery.sched_id#-Comments')">Comments</a></td>

Works like a charm ;-)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ColdFusion Language

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.