Coldfusion.navigate

I’m playing a bit around with the <cflayout> and <cfdiv> tags, but I’m having bit of a problem getting the <cfdiv> tag to work using Url variables?

As a test case I try to make a simple photo changer, so I have a page with links and the <cfdiv> tag and a page withe the photos:

links.cfm:


<cfajaximport tags="cfdiv">

<!--- Query to get the links --->

<cfoutput query="getPhotos">
<a href="javascript:Coldfusion.navigate('photos.cfm?photo=#photo_id#', 'photo_frame' )"> Photo #photo_id# </a>&nbsp;&nbsp;
</cfoutput>

<cfdiv id="photo_frame" name="photo_frame" bind="url:photos.cfm" />

photos.cfm:


<cfquery name="getPhotos" datasource="#Application.dsn#">
	SELECT
  			photo_id
      ,	photo
  FROM
  			gallery_photos
	WHERE
  			photo_id = #Url.photo#
</cfquery>

<cfoutput query="getPhotos">
<img src="gallery_photos/photos/#getPhotos.photo#" alt="" /> 
</cfoutput> 

But no matter what I try the photo won’t change. The links show the right parameters, but nothing is happening. And there is hardly any information I can’t find covering this subject? I Gooled for <cfdiv> Coldfusion.navigate but hardly any results.

This is kind of weird. Or maybe I simply don’t understand the principle.

I included the links in the photos.cfm page (the one that is loaded in the <cfdiv> tag and used ajaxlink instead Coldfusion.navigate


<cfoutput query="getLinks">
<a href="#ajaxlink('photos.cfm?photo=#photo_id#' )#"> Photo #photo_id# </a>&nbsp;&nbsp;
</cfoutput>

and it works fine.

Can someone please explain to me why the first method I tried (the links on the same page as the cfdiv tag) isn’t working and the second one as described above is?

Wasn’t that strange after all, was just the case sensitivity I was not aware off:


Coldfusion.navigate

Should be:


ColdFusion.navigate

For anyone who experience similar problems

You know, Donboe, there are a myriad of threads here that you start and ultimately answer yourself. Not to sound rude, but have you taken it upon yourself to find a structured learning method for ColdFusion?

I find the Web Application Construction Kit series of books (WACK) are thorough and very informative.

I have a co-worker who is the type of developer who feels that when he needs to know something, he merely looks it up in a book. It’s kind of a piecemeal method to learning that leads to a lot of guessing rather than knowing. But mayhaps a structured reading study might help you out more.

Of course, there’s no issue asking questions on a forum; I just kinda made a realization about these posts.

ColdFusion is not case sensitive, but you were actually invoking a Java object, and Java is case sensitive.

No offense taken :). I’m trying indeed to find the right sources to upgrade my knowledge. That doesn’t take a way the fact, that in the meantime I’m working on projects, that sometimes need an immediate solution. Beside of that, although I like Coldfusion a lot, I find the information provided (also in regards to what books to buy) very poor. I downloaded several trial chapters, to see what book or books would fulfill my needs most, but even there It’s hard to decide! I found the information stream way more accurate and helpful when the products I’m using were still owned by Marcomedia.

Off Topic:

I never said Coldfusion is case sensitive, I mentioned the way I used Coldfusion.navigate was wrong, which is indeed invoking a Java object

I have found several solutions in donboe’s self-solved threads while searching the forum, so they’re not going to waste! Thanks for posting your solutions instead of just saying “nevermind, I figured it out”.

Glad I could be of any help :slight_smile: