Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Mulitple URL Variables in CFWINDOW - Destroy / Create

Posted on 2008-10-30
Medium Priority
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="javascript:ColdFusion.Window.show('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="javascript:ColdFusion.Window.show('#ServicesQuery.sched_id#-Comments')">Comments</a></td>

Works like a charm ;-)

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

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

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

578 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