BrizUK Posted October 14, 2004 Posted October 14, 2004 A search for records using two parameters is setup. P1 is set by an entry in a form and P2 by a hidden script. Found records are displayed using [FMP=RangeStart], [FMP-RangeEnd] and [FMP-CurrentFoundCount]. This gives the correct number of records displayed on the first results page and the correct total of records meeting the search criteria. As the number of records displayed on ther page is less then the total found [FMP-LinkNext] and [FMP-LingPrevious] are used. However on moving to the continuation page the continuing count of records is correct but the count of total records is wrong. This latter is using the total of records using P1 only, set in the form, which is larger than the found set using the two parameters. Not only that but this larger total of records is displayed. I have tried running the script (which provides P2) in all sorts of positions in the coding including in between the [FMP-LinkNext] and [/FMP-LinkNext] tags in the hope that P2 would effectively be re-used or refreshed in some way. All to no avail. What surprises me about this is that the identical code worked correctly with FMPro 4.1.1 but does not do so under FMPro 5.5
Garry Claridge Posted October 14, 2004 Posted October 14, 2004 By a Script, do you mean Javascript? What do the rendered links [FMP-LinkNext] and [FMP-LinkPrevious] look like? Good Luck. Garry
BrizUK Posted October 14, 2004 Author Posted October 14, 2004 Thanks, Garry for taking an interest in another of my problems I should have made it clear that the script is an FMP script. I have used real names of database, fields and contents etc below. The results presented are the contents of three fields from each record. The first page displays 1 through 20 of 50 found entries. The total 50 is correct as shown by a search on the standalone database on my desktop. FMP-LinkNext is: FMPro?-db=list.fp5&-format=genreply.html&-lay=entry form&-sortfield=webyes&sortorder=descend&Town=london&-max=20&-skip=20&-token.0=P2&-find= The above takes me to the second page. This page displays 21 through 40 of 97 found entries. The total 97 is found on the standalone database by searching for Town only, not using the parameter as set by the Token. FMP-LinkPrevious is: FMPro?-db=list.fp5&-format=genreply&-lay=entry form&-sortfield=webyes&-sortorder=descend&Town=london=london&-max=20&token.0=P2&-find= This takes me back to the first page where it now displays 1 through 20 of 97 found entries. In looking further at the information I have given you it now seems to me that the problem is with the token as it is not associated with a field, P2 being the search content as in Town=london. This token is used for various purposes in the system, for selecting FMP scripts and displaying text. However, now having, I think identified the problem I do not immediately see how to resolve it. The parameter as used by the token cannot be entered into the form in which the Town parameter is entered without making significant changes to the system and requiring the user to provide further information which is better automated. I hope I have expressed the problem more clearly and you can give some guidance towards a solution.
Garry Claridge Posted October 15, 2004 Posted October 15, 2004 Does the initial search Form look like something like this: <input type="hidden" name="-db" value="list.fp5"> <input type="hidden" name="-lay" value="entry form"> <input type="hidden" name="-format" value="genreply.html"> <input type="hidden" name="-max" value="20"> <input type="hidden" name="-sortfield" value="webyes"> <input type="hidden" name="-sortorder" value="descend"> Enter Town: <input type="text" name="Town" value=""> Other Parameter: <input type="text" name="????" value=""> <input type="hidden" name="-token" value="?:?"> <input type="submit" name="-find" value="Search"> I'm not sure how the "-token" is used in the initial search! Or how it is set. Do you use a "-script" in the initial search? If so, how do you set the second search parameter? All the best. Garry p.s. You may be able to use some simple Javascript to achieve what you need.
BrizUK Posted October 15, 2004 Author Posted October 15, 2004 Garry, Overnight I have had a Eureka moment. I have set up a further hidden input which associates the value of the token with the required hidden search field. It now all works! In fact it now looks as if I can simplify some of the other coding as the FMP script I was using may not now be needed. Thanks for your reply just picked up. Yes the initial search form uses the coding you indicate with the addition of extra fields for further user input if desired. The -script is used in the initial search to add a variable entry in another field and which I may now be able to achieve another way. I almost think I should say 'Sorry you've been troubled' as I nearly got there by myself but your initial reply did set me off on another route. Many thanks, Tony
Keith M. Davie Posted October 15, 2004 Posted October 15, 2004 Tony, it is a good thing that you are finding other ways than the use of ScriptMaker. ScriptMaker is single-threaded and does not queue near-simultaneous event requests. CDML (in and of itself) does not recognize when ScriptMaker fails to perform an event which can result in erroneously informing the client (and data loss). While it is possible for a novice to FMP to develop a workaround to the problems so that ScriptMaker can run effectively over the www, your employer does not want to pay you to develop that workaround. Aside from ScriptMaker as a tool for effective security to completely remove "privileged" data from web accessed db files, there is really no need for the use of that engine. Structure your -finds with symbols such as exact field match and range and use tokens. Learn about the working of the -lop. Sometimes -finds can be enhanced with inlineactions either through a refresh page or directly on the results page. Find results can be enhanced with the use of the fmp-if on the results page. There's lots to play with when using -find.
BrizUK Posted October 27, 2004 Author Posted October 27, 2004 Keith, Thanks for your comments and advice. I have only just picked up your post as I have been taking some time off away from computers! Tony
Recommended Posts
This topic is 7324 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