Solved

Need to pass a variable with a cfdiv

Posted on 2013-11-20
5
390 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
[X]
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
  • 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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

734 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