Solved

Need to pass a variable with a cfdiv

Posted on 2013-11-20
5
355 Views
Last Modified: 2013-11-20
I need to pass a url variable to the bind page in a cfdiv. Below is what I have but when it loads I receive the error: permission denied.

<cfdiv id="thediv" bind="url:/mysite/mydir/mypage.cfm?mykey=#url.meykey#" />

Thank you.
0
Comment
Question by:earwig75
  • 3
  • 2
5 Comments
 
LVL 52

Expert Comment

by:_agx_
ID: 39663689
On which page?

The code you posted works fine as long as #url.meyKey# (is that a typo?) is defined on the page containing the CFDIV:

testPage.cfm
<!--- define variable you're passing --->
<cfset url.meykey = "testing">
<cfdiv id="thediv" bind="url:/mysite/mydir/mypage.cfm?mykey=#url.meykey#" />

/mysite/mydir/mypage.cfm
MyPage.cfm
<cfdump var="#URL#">

result:
MyPage.cfm
struct
     _cf_containerId | thediv  
     mykey              |  testing
0
 

Author Comment

by:earwig75
ID: 39663714
The first page, testPage.cfm has url.mykey in the URL already. I get an undefined message in IE.
0
 
LVL 52

Accepted Solution

by:
_agx_ earned 500 total points
ID: 39663761
Well according to the error message "mykey" isn't in the URL already.  On "testPage.cfm", dump the URL scope before the CFDIV.  Does it contain "mykey"?

testPage.cfm
      <cfdump var="#URL#">
      <cfdiv id="thediv" bind="url:/mysite/mydir/mypage.cfm?mykey=#url.meykey#" />

Also double check the spelling of the variable name. Is it "myKey" or "meyKey"?

You may need to set a default value for it w/cfparam so that it always exists. I don't know which variable name is correct, so I'll use "myKey"

 testPage.cfm
      <cfparam name="url.mykey" default="some default value here">
      <cfdiv id="thediv" bind="url:/mysite/mydir/mypage.cfm?mykey=#url.mykey#" />
0
 
LVL 52

Expert Comment

by:_agx_
ID: 39663784
> when it loads I receive the error: permission denied.

Wait a sec ... did you edit the question? That's a different error altogether. Can you please post the complete error message as well as the type of error (CF error, ajax logs, ....)
0
 

Author Closing Comment

by:earwig75
ID: 39664350
It is working now. The error was different in Firefox than in IE so I thought it had changed.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

758 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

20 Experts available now in Live!

Get 1:1 Help Now