Neo_Anderson Posted March 10, 2003 Posted March 10, 2003 I'm trying to make a search page where the user has a choice of viewing the data in two different formats. However, I want the number of records displayed different for each format. Example: If the Summary view is selected then 10 records per page are displayed If Detail view is selected then only 1 record is display. How do I go about setting up my Form for the search page this way? I understand if I make a select option pull-down I can choose the format type, but I can't see how you attach the number of -max to it
iSolve Posted March 11, 2003 Posted March 11, 2003 One possible solution, which isn't as elegant as I am sure you had hoped for, may be the following: Inside the <head> of each of the -format files place the following syntax: [FMP-If: CurrentMax .neq. ((-Max))]<meta http-equiv="Refresh" content="0;[FMP-Link: m]&-max=((-Max))"> [/FMP-If] Replace "((-Max))" with the number you want the Max to be. What will happen is: 1) the format file will load 2) the FMP-If process will compare the current maximum number of records per page with the number of records per page you want to be shown on that specific format page 3) If the max number doesn't match, the format file will reload, but on reload will change the max number so that it does match. If you have 2 format files, with one of them being the most commonly used, have the -Max parameter set to the number which relates to that format file, this way the processing will be reduced as the reloading will happen only when the less common of the two is accessed. It should also be noted that the user may see a flicker when the reload is performed, but it shouldn't be a major issue. Luke
Neo_Anderson Posted March 11, 2003 Author Posted March 11, 2003 In thinking about this overnight, I was wondering could Javascript solve my delima? I'm a little rusty but could an if/then statement somehow be used to have the layout choices adjust the resulting -max values? If so would this be better embeded in the HTML page or as a seperate .js file? Another thought I have is related to the FMP-include tag. I have a file called formats.htm. In here I have if/then statemates that relate to when -find, -edit, -new, -dup, or -delete action is performed. Once again this is all related to the example provided by Filemaker in its employee database example. So this file basically states If a -find action is perform format the page to these specs. The specs are contain in another page snipit called a summary.txt file. I have made a detail.txt file that contains the format required for a detail view. Can I have a conditional FMP statement within a conditional FMP statement? Somehow I want to say if the find action has a input value of summary then display summary.txt with a -max value of 10, and if the find action has an input value of complete then display detail.txt with a -max value of 1. Am I on the right track? Thanks again for your help.
Garry Claridge Posted March 11, 2003 Posted March 11, 2003 The Javascript would be relatively easy. Alternatively, you could use a method which combinds "-view", [FMP-If], [FMP-Include] and [FMP-Link]. With the Javascript method you could have a a Form for each Action. When an Action is selected a Javascript function can assign values to Input Elements and then submit the Form. All the best. Garry
Neo_Anderson Posted March 12, 2003 Author Posted March 12, 2003 Yeah! Javascript was succesful in solving my problem. I had a little assistance from a Cold Fusion expert who provided some insites, but it does work now! My next step is to make sure this data base I'm working on is protected with securtiy. Thanks for all your help! This is a great site
Recommended Posts
This topic is 7996 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