mindtpi99 Posted September 16, 2003 Posted September 16, 2003 Hi In my website I want to be able to add a link that allows the user to step through each record in a _found_ set (like the flip folder on the left in FileMaker). I've tried using <a href="FMPro?-DB=jobs.fp5&-Format=jobdetail.htm&-Skip=1&-Max=1&-Find">Next Record</a>
mindtpi99 Posted September 16, 2003 Author Posted September 16, 2003 mindtpi99 said: Hi In my website I want to be able to add a link that allows the user to step through each record in a _found_ set (like the flip folder on the left in FileMaker). I've tried using <a href="FMPro?-DB=jobs.fp5&-Format=jobdetail.htm&-Skip=1&-Max=1&-Find">Next Record</a> But it steps through each record in the whole database - how do I constrain it to only step through each successive record in the found set only? Thanks!!
Garry Claridge Posted September 16, 2003 Posted September 16, 2003 Try this: <a href="[FMP-Link:k]&-Skip=[FMP-CurrentRecordNumber]">Next Record</a> I haven't tried it. However, it may be worth a go! Good Luck. Garry
mindtpi99 Posted September 16, 2003 Author Posted September 16, 2003 Garry Claridge said: Try this: <a href="[FMP-Link:k]&-Skip=[FMP-CurrentRecordNumber]">Next Record</a> Does the same thing - but thanks for your suggestion
Garry Claridge Posted September 16, 2003 Posted September 16, 2003 It will only step through all of the records if you do not use any find criteria. That is why you should use a [FMP-Link], it will include the original find criteria. Good Luck. Garry
ErnieG Posted September 16, 2003 Posted September 16, 2003 Is there a reason you don't want to use: [FMP-linkprevious]Previous record[/FMP-linkprevious] [FMP-linknext]Next record[/FMP-linknext] On the page that creates the found set, I have <input type="hidden" name="-Max" value="1"> allowing users to flip through each record page one at a time. Ernie
mindtpi99 Posted September 16, 2003 Author Posted September 16, 2003 ErnieG said: Is there a reason you don't want to use: [FMP-linkprevious]Previous record[/FMP-linkprevious] [FMP-linknext]Next record[/FMP-linknext] Yes, what I want is to display the entire found set as a list and, when the person goes to the detail view page, they can flip through the records that way. I take it from your post that you search for data it displays the results one record at a time rather than as a complete list first? thanks for your suggestion tho...
Steve T. Posted September 17, 2003 Posted September 17, 2003 Howdy! Here's a COPY/PASTE of an article I stashed away in my personal notes db. Hope it helps! --ST http://www.filemaker.com/ti/106538.html CDML Record Navigation with FMP Link Tag ------------------------------------------------------------------------ This article assumes that you have at least a basic knowledge of CDML, HTML, and creating FileMaker calculation fields. CDML provides many useful tags that make navigating through a found set of records (commonly referred to as a "hit list") easier. Through the combination of -max,-skip and FMP-LinkPrevious and FMP-LinkNext tags, the computer can return subsets of the hit list with previous and next links on each page rather than the entire found set on a single page. If you have a found set of more than 100 records, it's easy to understand how having the ability to segment the found set is necessary. But what if you want to take this a step further and provide previous and next links between each individual detail page? There are a few different ways to do this, but most of them involve some complex combination of frames and Javascript. The following solution is a much more elegant method that involves the creation of one additional calculation field and one of the most powerful CDML tags, FMP-Link. Here's how it's done: First define the following calculation field: Recordskip(Number result, Unstored): Status(CurrentRecordNumber) - 1 This field must be placed on the layout that will be called by the "-lay" tag on your search page. It is also pertinent that it be defined as an unstored calculation. To define the calculation as unstored, click on the Storage Options button on the lower right hand corner of the Specify Calculation dialog box. Then, check "Do Not Store Calculation Results - Calculate only when needed." The purpose of this calculation is explained below. The initial search page that you've created does not need to be changed at all. The only concern here is, as specified above, that the layout specified with "-lay" contains the unstored calculation field described above. The BODY of your format or results page should now contain something like the example below: <TABLE> [FMP-Record] <TR> <TD><A HREF="[FMP-Link:rmk]&-format=detail.html&-skip=[FMP-Field:Recordskip]&-max=1">[FMP-Field:Field1]</A></TD> </TR> <TR> <TD>[FMP-Field:Field2]</TD> </TR> [/FMP-Record] </TABLE> <P> [FMP-LinkPrevious]Previous[/FMP-LinkPrevious] [FMP-LinkNext]Next[/FMP-LinkNext] Notice that this format page does not use FMP-LinkRecID, the usual method of linking to a record detail page. FMP-LinkRecID is not necessary in this case, since the individual record ID, which is required for performing detail page operations such as editing, duplicating or deleting a record, is also passed to the detail page using FMP-Link. FMP-Link (described in more detail in the CDML Reference database) is a powerful CDML tag that allows you to specify as a parameter one or more key letters. Each of these letters represents an omitted portion of the current page's URL. For this solution, three key letters must be specified: "r" which represents the current "-format" page; "m' which represents the current "-max"; and "k" which represents the current "-skip". Once these parts are omitted, they can be replaced using regular CDML URL syntax. The new format page should be your detail page, the max should be "1", since the detail page needs to show individual records, and the skip should be set to the field value of the calculation described above. The skip needs to be replaced because its value is different for every record in the found set. This is why the above calculation must be unstored. When there is a new found set, the calculation field is reevaluated and the data is sent to the web companion. The beauty of this solution is that once it is sent to the web companion and to the client browser, it is a hard coded link. There is no danger of another browser request altering any part of that link including the -skip. The body of the detail page should look something like the following: [fmp-if:currentaction.neq.find] You have modified the record successfully!<P> <a href="the_search.html">New Search</a> | <a href="[fmp-currenttoken: URL]&-max=25&-format=the_result.html&-find">Back to Hitlist</a> [fmp-else] <form action="fmpro"> <input type="hidden" name="-db" value="countries"> <input type="hidden" name="-RecID" value="[fmp-currentrecid]"> <input type="hidden" name="-lay" value="web"> <input type="hidden" name="-token" value="[fmp-link:rsmta]"> <input type="hidden" name="-format" value="the_detail.html"> <input type="text" name="country" value="[fmp-field:country]"><BR> <input type="submit" name="-edit" value="edit"> <input type="submit" name="-dup" value="duplicate"> <input type="submit" name="-delete" value="delete"> [fmp-currentrecid] </form> <a href="the_search.html">new search</a> | <a href="[fmp-link:krm]&-format=the_result.html&-max=25"> Back to Hitlist</a> | [fmp-linknext]next[/fmp-linknext] | [fmp-linkprevious]previous[/fmp-linkprevious] [/fmp-if] This example detail page is fairly complicated since it is used to perform deleting, duplicating and editing. Because the skip and max parts of the link were modified on the previous page, fmp-linkprevious and fmp-linknext can be used for the previous and next links. Also included is a "Back to Hitlist" link. This is optional, of course, but if a "Back to Hitlist" link is not provided, the browser's back button will have to be clicked many times if you have navigated through the previous and next links. FMP-Link, this time with the action modified to "find", can also be set as a token, so that if an action on a detail page has been carried out, the token can be passed to a "Back to Hitlist" on the resulting format page.
ErnieG Posted September 17, 2003 Posted September 17, 2003 Thanks for passing that along, Steve. Now I've stashed it away for myself. You're right about your assumption, mindtpi99, and I missed that you wanted to carry the found set from list to detail page. I probably just have an easier-to-handle situation. For what it's worth, I give the user a choice, at first, of viewing the find results as a list or single detail pages. But when they go to the list view, they see key identifying fields, which they can of course scroll. In the list, each line contains a link to open that record as a detail page IN A NEW WINDOW. Thus they can view/edit the details, then simply close the window to return to the list, keep scrolling to find the next record they're interested in, and open it in another new window. That's what worked for me, anyway. Ernie
Unable Posted September 18, 2003 Posted September 18, 2003 The ti doc. to which Steve T.refers is interesting. Steve, have you used successfully the code which is recommended? I am able to misunderstand many things, including CDML Linking to the next record
Steve T. Posted September 18, 2003 Posted September 18, 2003 Hi, Unable! Nope, never touched it. It may even be from the FMP4 days but it rang a bell when they were talking about it so I just plopped it out there hoping it could be useful. It's almost exactly what was asked for. I haven't read it for a long time but I got it because I thought it could help me someday... (I snatched it when I was trying to teach myself CDML... LOL! I'm still learning!) Haven't gotten around to any of the samples files in FMFORUMS yet but I hope to browse/contribute someday. --ST
mindtpi99 Posted September 22, 2003 Author Posted September 22, 2003 Thanks for everyones help - I'll read through the suggestions and see if I can sort something out!!
Unable Posted September 23, 2003 Posted September 23, 2003 Seeing the above response from mindtpi99 reminds me of what Steve wrote in response to my query if he had ever tried the tag, "Nope, never touched it." But Steve, if you have not tried the tag as you say, which must mean that you don't know how it works, whatever would make you think that "It's almost exactly what was asked for."?
Steve T. Posted September 24, 2003 Posted September 24, 2003 Hi, Unable! mindtpi99 said : "Yes, what I want is to display the entire found set as a list and, when the person goes to the detail view page, they can flip through the records that way." The article I posted is about having a found set "hitlist" and then being able to navigate record-by-record from the detail page... sounds the same to me, at least. I never wanted this kind of thing in any of my solutions so never bothered trying it out. Help was asked for; I offered what I could. --ST
Garry Claridge Posted September 24, 2003 Posted September 24, 2003 mindtpi99's problem is at the point he selects a record to view, he then loses his search criteria. Hence, he then cannot "walk" through the "Found Set". He will need to devise a method of retaining the search criteria. Tokens may be the means of achieving this! A mere mental challenge All the best. Garry
Unable Posted September 24, 2003 Posted September 24, 2003 re: A mere mental challenge Yes, which is why I first suggested the Sample Files forum, and then provided a specific link.
Garry Claridge Posted September 24, 2003 Posted September 24, 2003 That "hooplah.htm" file takes some of the challenge out of it Well done! All the best. Garry
Unable Posted September 24, 2003 Posted September 24, 2003 That's what the hooplah is all about. Thanks.
Recommended Posts
This topic is 7801 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now