ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 7th, 2006, 11:29 AM
derekwit derekwit is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2006
Posts: 10 derekwit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 36 m
Reputation Power: 0
Unhappy Detailed page - navigation - next - previous HELP!!!

I have created a master page that is for my picture gallery I am using the
thumbnail as a link to my detail page. On my detail page I am showing a
full-size image of the thumbnail. I am trying to setup a previous and next
button that are dynamic with my database I went to Recordset paging and used
Next and Previous but it does not work. I must be missing something can
somebody please give me some assistance. Thanks in advance for the help.

Reply With Quote
  #2  
Old March 7th, 2006, 12:53 PM
kiteless kiteless is offline
Moderator
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 4,084 kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 10 h 42 m 46 sec
Reputation Power: 780
Quote:
Originally Posted by derekwit
...I went to Recordset paging and used
Next and Previous but it does not work.
"does not work" doesn't help anyone diagnose your problem. You'll have to be more specific. What doesn't work? Do you get an error? Does it do something unexpected?

Reply With Quote
  #3  
Old March 7th, 2006, 01:19 PM
derekwit derekwit is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2006
Posts: 10 derekwit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 36 m
Reputation Power: 0
Sorry about that. When I said it does not work I mean that the next and previous link I create does not work. If you click either next or previous it stays on the same image you are on that was passed through the master page. Here is a link to that page www.tuscanstonemantels.com/gallery.cfm
then click on any image it will take you to the detail page. Thanks for such a quick response. Hope this was useful.

Reply With Quote
  #4  
Old March 7th, 2006, 01:40 PM
kiteless kiteless is offline
Moderator
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 4,084 kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 10 h 42 m 46 sec
Reputation Power: 780
Well the problem is that your next and previous links are the same as the current page, that is, they aren't pointing to different images via the url variable "tuscan". So you need to have a query or something run and use the result(s) of the query to feed different image names to the tuscan url variable.

Reply With Quote
  #5  
Old March 7th, 2006, 01:43 PM
derekwit derekwit is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2006
Posts: 10 derekwit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 36 m
Reputation Power: 0
Can you give pointers or direction where I could find out what query I should run. A little new to the CF game.

Reply With Quote
  #6  
Old March 7th, 2006, 02:33 PM
kiteless kiteless is offline
Moderator
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 4,084 kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 10 h 42 m 46 sec
Reputation Power: 780
Well now you're asking about SQL which is specific to your database and your table structure. One way to do it would be to assign a sequential ID to each image, and then since you know the current image ID (say it is 5) you can query for the next highest and lowest record IDs to use in your next and previous buttons.

Reply With Quote
  #7  
Old March 9th, 2006, 08:41 PM
derekwit derekwit is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2006
Posts: 10 derekwit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 36 m
Reputation Power: 0
MS Access Database

I've have gone through a lot of different technotes as well as tutorials but still no success. I am going to need help from somebody that can give me some coding assistance. Here is a link to my master page just click any picture it will take you to my detail page. Thanks for any help given....

http://www.tuscanstonemantels.com/gallery.cfm

Reply With Quote
  #8  
Old March 9th, 2006, 09:43 PM
kiteless kiteless is offline
Moderator
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 4,084 kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 10 h 42 m 46 sec
Reputation Power: 780
Here's some sample code I whipped up:

Code:
<cfparam name="url.currentImageID" default="1" />

<cfset myBaseQuery = queryNew('imageID,imageName') />
<cfset queryAddRow(myBaseQuery) />
<cfset querySetCell(myBaseQuery,'imageID',1) />
<cfset querySetCell(myBaseQuery,'imageName','image1.jpg') />
<cfset queryAddRow(myBaseQuery) />
<cfset querySetCell(myBaseQuery,'imageID',4) />
<cfset querySetCell(myBaseQuery,'imageName','image19.jpg') />
<cfset queryAddRow(myBaseQuery) />
<cfset querySetCell(myBaseQuery,'imageID',9) />
<cfset querySetCell(myBaseQuery,'imageName','image44.jpg') />
<cfset queryAddRow(myBaseQuery) />
<cfset querySetCell(myBaseQuery,'imageID',12) />
<cfset querySetCell(myBaseQuery,'imageName','image6.jpg') />

<cfquery name="getCurrentImageInfo" dbtype="query">
select imageID, imageName from myBaseQuery
where imageID = #url.currentImageID#
</cfquery>

<cfquery name="getPriorImageID" dbtype="query">
select max(imageID) as imageID from myBaseQuery
where imageID < #url.currentImageID#
</cfquery>

<cfquery name="getNextImageID" dbtype="query">
select min(imageID) as imageID from myBaseQuery
where imageID > #url.currentImageID#
</cfquery>

<cfoutput>
The current image is ID #getCurrentImageInfo.imageID# and name #getCurrentImageInfo.imageName#<br />
<cfif getPriorImageID.recordCount><a href="#cgi.script_name#?currentImageID=#getPriorImageID.imageID#">Previous</a></cfif><br />
<cfif getNextImageID.recordCount><a href="#cgi.script_name#?currentImageID=#getNextImageID.imageID#">Next</a></cfif>
</cfoutput>

Reply With Quote
  #9  
Old March 10th, 2006, 10:45 PM
derekwit derekwit is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2006
Posts: 10 derekwit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 36 m
Reputation Power: 0
Kiteless thanks for the code but I am still a little to green maybe you can break it down a little more for me. I am extremely sorry to keep bothering you but I am really trying to get this concept.

I was just going over my page and I am noticing that the detailed.cfm page is only pulling (1) record so do I need to create another recordset on that page because the URL is being pushed through from the (Master) page gallery.cfm. Like I said I am real green but it sounded like it might be a way to scroll through all of my records

Quote:
Originally Posted by kiteless
Here's some sample code I whipped up:

Code:
<cfparam name="url.currentImageID" default="1" />

<cfset myBaseQuery = queryNew('imageID,imageName') />
<cfset queryAddRow(myBaseQuery) />
<cfset querySetCell(myBaseQuery,'imageID',1) />
<cfset querySetCell(myBaseQuery,'imageName','image1.jpg') />
<cfset queryAddRow(myBaseQuery) />
<cfset querySetCell(myBaseQuery,'imageID',4) />
<cfset querySetCell(myBaseQuery,'imageName','image19.jpg') />
<cfset queryAddRow(myBaseQuery) />
<cfset querySetCell(myBaseQuery,'imageID',9) />
<cfset querySetCell(myBaseQuery,'imageName','image44.jpg') />
<cfset queryAddRow(myBaseQuery) />
<cfset querySetCell(myBaseQuery,'imageID',12) />
<cfset querySetCell(myBaseQuery,'imageName','image6.jpg') />

<cfquery name="getCurrentImageInfo" dbtype="query">
select imageID, imageName from myBaseQuery
where imageID = #url.currentImageID#
</cfquery>

<cfquery name="getPriorImageID" dbtype="query">
select max(imageID) as imageID from myBaseQuery
where imageID < #url.currentImageID#
</cfquery>

<cfquery name="getNextImageID" dbtype="query">
select min(imageID) as imageID from myBaseQuery
where imageID > #url.currentImageID#
</cfquery>

<cfoutput>
The current image is ID #getCurrentImageInfo.imageID# and name #getCurrentImageInfo.imageName#<br />
<cfif getPriorImageID.recordCount><a href="#cgi.script_name#?currentImageID=#getPriorImageID.imageID#">Previous</a></cfif><br />
<cfif getNextImageID.recordCount><a href="#cgi.script_name#?currentImageID=#getNextImageID.imageID#">Next</a></cfif>
</cfoutput>

Reply With Quote
  #10  
Old March 11th, 2006, 10:46 AM
kiteless kiteless is offline
Moderator
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 4,084 kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level)kiteless User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 10 h 42 m 46 sec
Reputation Power: 780
Yes you'd want three queries, one for the currently displayed item information, one to determine the previous image, and one to determine the next image. Note that all of this hinges on using a numeric ID field in the database so that you can determine which ID's are before and which are after the current item.

Reply With Quote
  #11  
Old March 11th, 2006, 10:38 PM
derekwit derekwit is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2006
Posts: 10 derekwit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 36 m
Reputation Power: 0
I do have an autoid field it is itemid. Now I pass a url from my gallery.cfm page over to my detailed.cfm. I am using this string ?tuscan=#web.LocationFull# so when they click on my thumbnail it retreives data from my database and displays the larger image of the thumbnail. Which I am sure that was nothing you did not already know. My question now is that when it is on my detailed.cfm page that particular string in the browser is: http://www.tuscanstonemantels.com/Detailed.cfm?tuscan=/images/full/image01.jpg which is only (1) item being returned from the database not the entire database. I said all of that to say this will the code you created above work for my application if I change the necessary field names.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Detailed page - navigation - next - previous HELP!!!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT