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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL script to confirm data has been entered into a table. 2 24
Jquery driving me nuts... 14 29
Hide and Unhide Table 6 27
Display Flex does not Wrap Items 2 13
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

730 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