Solved

Need to pass a variable with a cfdiv

Posted on 2013-11-20
5
372 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

The technique is by far very Simple! How we can export the ColdFusion query results to DOC file?  Well before writing this I researched a lot in Internet but did not found a good Answer anyways!  So i thought now i should share my small snippet w…
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…
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

830 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