problems passing query variable into cfwindow.
Hello;
I'm writting a small custom app for a friend. I need to make a "user interface" for this project. The only thing that needs to be allowed to be updated is a new file I have set up in an admin section. The front end is more like an interface with 4 numbered links that will never change, so it is "hard coded" and not database driven.
When I click on my link to open up my cfwindow I get this error: (it also happens when I do a cfdump for url.a)
Element A is undefined in URL. | |
| The error occurred in C:\websites\Vid1.cfm: line 9 | |
7 : SELECT pastVid.title AS ViewField1, pastVid.MYFile AS ViewField2, pastVid.companyID 8 : FROM pastVid 9 : WHERE vidID = <cfqueryparam value="#URL.a#" cfsqltype="cf_sql_integer"> 10 : </cfquery> 11 : <cfset APPLICATION.vidCli=vidCli> | |
I realize when dealing with a cfwindow you can't pass url variables to it normally like from page to page. How do I pass this variable? I've been running searches on the web and have come up dry on this. I also have one other question. in the pop up window, how to I create a link to just reload the pop up (cfwindow) and pull the query I'm looking for? The links I am using now, close the window and open up a full page in the place of the web site that launched the window.
Can anyone help me with this? Here is my code so far. It shouldn't have to be changed much, I'm mostly missing a variable to pull from, in place of the url.
Parent Page Code (cfwindow launch page)
<cfajaximport tags="cfwindow" />
<cfwindow
name="myWindow"
center="false"
closable="true"
draggable="true"
height="450"
initShow="false"
minHeight="400"
minWidth="430"
refreshOnShow = "true"
source = "Vid1.cfm"
resizable="true"
title="Pasture Videos"
x="100"
y="100"
width="470"></cfwindow>
<cfoutput>
<a href="javascript:ColdFusion.Window.show('myWindow');ColdFusion.navigate('Vid1.cfm?a=1','myWindow');">Video 1</a>
<a href="javascript:ColdFusion.Window.show('myWindow');ColdFusion.navigate('Vid1.cfm?a=2','myWindow');">Video 2</a>
<a href="javascript:ColdFusion.Window.show('myWindow');ColdFusion.navigate('Vid1.cfm?a=3','myWindow');">Video 3</a>
<a href="javascript:ColdFusion.Window.show('myWindow');ColdFusion.navigate('Vid1.cfm?a=4','myWindow');">Video 4</a>
</cfoutput>
<cfset ajaxonload("init")>
CFWINDOW page code:
<cflock timeout="2" scope="APPLICATION" type="READONLY">
<cfquery name="vidCli" datasource="#APPLICATION.dataSource#" blockfactor="100">
SELECT pastVid.title AS ViewField1, pastVid.MYFile AS ViewField2, pastVid.companyID
FROM pastVid
WHERE vidID = <cfqueryparam value="#URL.a#" cfsqltype="cf_sql_integer">
</cfquery>
<cfset APPLICATION.vidCli=vidCli>
</cflock>
<cfoutput query="vidCli" maxrows="1">
#ViewField1#<br />
#ViewField2#<br />
</cfoutput>
<cfoutput>
<!--- these links are not working properly, I need to link to the cfwindow that is open and this opens a new one --->
<a href="javascript:ColdFusion.Window.show('myWindow');ColdFusion.navigate('Vid1.cfm?a=1','myWindow');">Video 1</a>
<a href="javascript:ColdFusion.Window.show('myWindow');ColdFusion.navigate('Vid1.cfm?a=2','myWindow');">Video 2</a>
<a href="javascript:ColdFusion.Window.show('myWindow');ColdFusion.navigate('Vid1.cfm?a=3','myWindow');">Video 3</a>
<a href="javascript:ColdFusion.Window.show('myWindow');ColdFusion.navigate('Vid1.cfm?a=4','myWindow');">Video 4</a>
</cfoutput>
Can anyone help me figure out how to make the owrk properly? I think I'm close
Thank you
