close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

master detail page - move specific record detail page

Thread began 8/21/2013 10:25 am by bentulk | Last modified 8/23/2013 12:49 pm by Jason Byrnes | 2248 views | 15 replies |

bentulk

master detail page - move specific record detail page

I am trying to create a master/detail page set whereby I can click on a link on the master page and go to a detail page to display more detail of that record.

I have acheived this without problem.

However, what i need is to be able to page through the detail page as well, instead of just filtering the recordset on the one item.

I have now built the master and detail pages with identical recordsets.

I need to know how to make the detail page 'move' to the correct position in the recordset, when the corresponding item is clicked on the master page.

I'll be passing an url parameter called 'itemid'.

Any help would be greatly appreciated. Including advice on a different approach if i am misguided in my effort and there is a better approach.

Thanks,

Ben

Sign in to reply to this post

Jason ByrnesWebAssist

you need to use 2 recodsets

one to look up the previous record, the other to lookup the next record.

rsPrevious:
SELECT * FROM tableName WHERE idColumn < paramID ORDER BY idColumn DESC LIMIT 1
Variables:
Name: idColumn
type: Integer
Default Value: -1
Runtime value: $_GET['itemid']

rsNext
SELECT * FROM tableName WHERE idColumn > paramID ORDER BY idColumn DESC LIMIT 1

Variables:
Name: paramID
type: Integer
Default Value: -1
Runtime value: $_GET['itemid']

Sign in to reply to this post

bentulk

I've been battling away with this all morning.
Could you take another look at your solution and let me know if this would work if my products are not sorted by their itemid on the master page?

I'd like to know before I carry on trying to get the solution to work.

If this will work when master page is sorted by something other than itemid, can you let me know if i need more than the two recordsets you mentioned? And what they are. (presumably a 'current item' recordset. Would that be filtered on 'itemid')

Thanks for any help you can give.

Ben

Sign in to reply to this post

Jason ByrnesWebAssist

the recordsets go on the details page, so the sorting on the master page will have no bearing on them.

Sign in to reply to this post

bentulk

Thanks for your reply.
The detail page set must be sorted in the same order as the master page set, so that when the user clicks 'next item' on detail page, it will correspond with the next item that they saw on the master page? Am i missing something here?

Also, could you let me know if i need more than the two recordsets you mentioned? And if so, what they are. (presumably i need a 'current item' recordset. Would that be filtered on 'itemid')

Apologies for all the questions.

Ben

Sign in to reply to this post

Jason ByrnesWebAssist

You can use any ordering you like, as long as it is consistent in all your recordsets.

  (presumably i need a 'current item' recordset. Would that be filtered on 'itemid')  



I would have thought you already had the current item recordset. the current item recordset would be:

rsCurrent
SELECT * FROM tableName WHERE idColumn = paramID ORDER BY idColumn

Variables:
Name: idColumn
type: Integer
Default Value: -1
Runtime value: $_GET['itemid']


NOTE: I noticed a problem in the original recordsets, i have updated them.

Sign in to reply to this post

bentulk

I have successfully got this working when the recordsets are sorted by a unique column (itemid for example). But when i try and do same, with recordsets sorted by price (where a number of same items can have same price), it is not working.

I've spent the afternoon trying to work out how to make it work. I am stumped.

Ben

Sign in to reply to this post

Jason ByrnesWebAssist

I'll need to troubleshoot directly, see the private message section.

Sign in to reply to this post

bentulk

private message posted

Sign in to reply to this post

Jason ByrnesWebAssist

your links where set to point to:
test_detail.php

instead of:
test_detail_price.php

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...