Mulitple URL Variables in CFWINDOW - Destroy / Create

Posted on 2008-10-30
Last Modified: 2008-10-30
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

Question by:AaronDitto
  • 3

Author Comment

ID: 22843595
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


Author Comment

ID: 22843742
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)

Accepted Solution

AaronDitto earned 0 total points
ID: 22843900
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 ;-)

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now