Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 6949 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I am new to Filemaker (from Access) and have run into a problem I just can't get a handle on. I'm hoping one of you fine folks can point me in he right direction. Extra details are at the bottom of the post.

In my main table (Catalog), each record can have many images associated to it. The number of images can vary by record from 0 to, say, 10. I would like to have one image display on the Catalog layout and be able to advance through the images one at a time using previous/next buttons.

I have created a layout with a portal to the images and "next/previous portal row buttons. Problem is, when I test this, the next/previous buttons only work if I have all the portal rows showing on the layout.

I have tried setting the portal up with a slider but the effect was poor (jumply etc.) I'd prefer not to go this route if possible - I want the images to jump so that only complete images show at any given moment. Sounds petty but there it is.

Additionally, in my previous/next button tests, when all portal rows are showing and I select "next portal record" a gray "field select" haze covers the next picture. Is there a way to script it so the next row is displayed but the field isn't actually entered?

Any help would be greatly appreciated.

BoomC

Details - if you want them:

Related Image Table:

Has three fields: a serialized primary key field, an ID field that holds the foreign key from the related Cataloging record and a container field for the image.

Catalog Layout:

Has a portal to the image table and two associated buttons using "Go to Portal Row [select; Next/Last]. Portal size is larger than the container it holds.

Posted

This is actually a bit harder than you would first think. But once you set it up it works fine. Basically rather than using a portal with a lot of rows, you can have a 1-row portal, or just 1 related field, which is much the same thing. This portal/field relationship would be based on the parentID to childID AND an ImageID (the unique ID of the image).

To set this ImageID, as well as advance it, you'd need to read the related IDs for the parent record. FileMaker has a function to do that, called ValueListItems(). It reads a Value List, so you'd need to create one, filtered by that relationship. Now you've got the IDs. You can then figure where the currently selected ImageID is in that list, and either advance one or retreat one, or stay the same (if on the 1st or last).

It's not the prettiest calculation, but I think it works. This one requires version 8. It could be done in 7, but it's even uglier. It also frees the buttons from needing to be in the portal.

My example file also has a portal of "thumbnails" along the side (from an earlier example). That's another way to flip through them; though with 10 it'd be kind of long.

ThumbsImages2.zip

Posted

Fenton,

This definately solves the problem but I'm going to have to play with it a bit to really understand what you've done.

Thanks for the help and especially the example file. Getting to see the script and tables really makes things clearer.

BoomC

Posted

The example is a little confusing because it has 2 different mechanisms for changing the main picture. Originally it just used the portal of thumbnails to change it. The method you mentioned, using <-- previous and next --> related record was added.

They both share the same relational idea however. That you set the unique ID of the related picture into a local field in the parent table, then use that AND the regular parent-child to show the picture (adding the parent ID stops the related picture from showing in EVERY parent record, as it would otherwise).

The calculation fields for Next and Previous are superfluous. I just used them so I could see if it was going to work when I used the same calculation in the relevant script.

You've probably never seen functions like Get (NthRecord). It's new to 8. Like I said, it's possible to do this without these 8-specific functions, but it's more difficult.

There is a 3rd alternative, which would be to use a double set of portals, with 5 rows/thumbs in each (you can set which rows are in a portal). That would be much the same as the single-portal approach. I kind of like that; you could see all the thumbs at once, and the big picture. Since you can set the rows for a portal, you could have 5 vertical, then 5 horizontal (under the picture). Just have the horizontals only show 1 row: 6, 7, 8, 9, 10. Or all the way around :(-!]

Posted

Ahhh... I think I've got it now. Actually, I had planned to have a second, seperate "image manager" layout with the rows of portals you describe to make view all related, adding and deleting images more friendly. You've been a big help - thanks again!

This topic is 6949 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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