Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Multiple Formats, Multiple results

Featured Replies

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 confused.gif

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

  • Author

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.

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

  • Author

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

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.