3 Replies Latest reply on Jun 26, 2014 8:13 AM by philmodjunk

    Sort Portal Row with a button

    anoobs

      Title

      Sort Portal Row with a button

      Post

           HI...

           I have two filemaker 12 files. 

           1) Personal Details

           2) Photo album

           I have 2 portals in "Personal details"  of Photo album,  Which shows  different stages of a project. The two portals are same First portal with number of 4 rows (small size like thumbnails)  and other is rows with 1 (big size).  When i click on the thumbnail photo in the portal1 the portal2 should show the same photo. Is there any way i can create a script like that?.

           Urgent!!!! pls help. Attaching the pic Below

           Anoob

      Screen_Shot_2014-06-26_at_3.04.24_PM.png

        • 1. Re: Sort Portal Row with a button
          philmodjunk

               See this thread for how to set this up: This is not an exact match, but the methods used can work for this as well. You don't actually need two portals, BTW, the large format container field does not need to be placed in a portal in order for this to work.

          • 2. Re: Sort Portal Row with a button
            anoobs

                 Thanks Phil.

                 I will elaborate little more. The two portals are are same with different row numbers. The big one is for the zoom view and small portal will help the client to choose the photos according to their need. I already got a an idea for this but sometimes it wont work. And i couldn't figure out why??...

                 Ok.. so the right portal will act as a thumbnail. I want to choose the photo from right container and at the same time after the 'click' the left portal should sort the photo to first row. so it will be visible as zoomed one.

                 Hope u Got the point.

            • 3. Re: Sort Portal Row with a button
              philmodjunk

                   Yes, but the zoom view field does not need to be in a portal.

                   Let's start with what I assume is the relationship that you already have:

                   LayoutTable::anyField X ImageTable::anyField

                   this relationship matches any record in the layout's table to all records in the portal table. You may have a different relationship, but that's not a problem as the method I describe will still work.

                   If you do not have a field that uniquely identifies each ImageTable record, add one. You can define __pkImageID as an auto-entered serial number and you can use Replace Field Contents with the serial number option to assign a serial number to all existing records. If you select the option to update auto-enter options when you use this tool to assign serial numbers to your records, the next new record will get the next serial number in the series.

                   Then make a new Tutorial: What are Table Occurrences? of ImageTable (select it and click the button with two green plus signs) and link it to LayoutTable like this:

                   LayoutTable::selectedImageID = ImageTable|Selected::__pkImageID    (ImageTable|Selected is the name I gave to the new table occurrence "box".)

                   Now add the container field from ImageTable|Selected to your layout and size it to be your large view of this image.

                   Then you can script a button in your portal of smaller sized images to perform this script:

                   Set Field [LayoutTable::SelectedImageID ; ImageTable::__pkImageID ]

                   You can use button set up to set up the container field in your portal to be the button that performs this script so that tapping the small view container field in the portal causes that image to appear in the large view field.