8 Replies Latest reply on Jun 14, 2017 3:54 PM by lindseym

    Preventing Slide from reverting to slide 1 after leaving and returning to layout

    lindseym

      Hello,

       

      I have a slide set up to make a "button", once the button is pushed it runs one of two scripts to set the field contents

       

      This is in the no record state

      Screen Shot 2017-06-14 at 2.34.57 PM.png

       

      When I select "RAW"

       

      Screen Shot 2017-06-14 at 2.35.32 PM.png

       

      Now if I leave this layout and return, this is what I get:

       

      Screen Shot 2017-06-14 at 2.35.44 PM.png

       

       

       

       

       

       

      What I want is the side of the button to appear Yellow when it is selected (the field is just on the layout to show me what is going on)

       

      I also realize I should have a 3rd stage of both being grey until the user selects one button.

       

       

       

      I got the idea to do it this way, but the FMP Starter solutions for contacts- the business and personal address.

       

      Thank you!

       

      -L

        • 1. Re: Preventing Slide from reverting to slide 1 after leaving and returning to layout
          philmodjunk

          Option 1:

          Give panels object names using the inspector. Have your script use go to object to bring the correct panel back to the front when it returns to the layout. This sometimes requires putting the current panel's object name into a global variable or passing it as a script parameter so that your script can put the correct panel in front upon return.

           

          Option 2:

          Don't leave the layout in the first place. You can open a hidden (off the monitor edge window) for doing your data modifications and then close the window when done, or you can do nearly all data manipulation--even in other tables, including creating new related records without leaving the layout if you set it up right.

           

          Note that having your script change layouts can have negative affects on more than which tab or slide control panel is visible. Portals can snap back to original positions and a long list of script triggers might get tripped and cause scripts that you don't want to run to run. There are ways to handle all of this when necessary, but the new window method avoids most of these (some triggers are still tripped) and if you can do it without even opening an extra window, you avoid all of the issues at the cost of possibly adding to the complexity of your data model.

          1 of 1 people found this helpful
          • 2. Re: Preventing Slide from reverting to slide 1 after leaving and returning to layout
            bigtom

            Is this a button bar? If so you can set the active section by a global variable.

            1 of 1 people found this helpful
            • 3. Re: Preventing Slide from reverting to slide 1 after leaving and returning to layout
              arjen.evertse

              If this is just about making your button showing what's in the field you can use a button bar. This will allow you to set the active button by calculation where you can test for the contents of your field.

               

              You will need to name the button elements ( not the button bar as a whole ) and can also make your calculation return "" in case nothing is in your field. This will cause both buttons to be inactive, the 3rd state in your description.

              1 of 1 people found this helpful
              • 4. Re: Preventing Slide from reverting to slide 1 after leaving and returning to layout
                lindseym

                It's not a button bar (unless I'm unclear of what a button bar is)

                • 5. Re: Preventing Slide from reverting to slide 1 after leaving and returning to layout
                  lindseym

                  I like option 2... Actually.. it is very rare a user would  leave the panel... as most things are automated from this first layout.

                   

                  I am going to add one more slide (set as slide 1)  and make it the default grey for both sides.

                   

                  Thank you!

                  • 7. Re: Preventing Slide from reverting to slide 1 after leaving and returning to layout
                    philmodjunk

                    I agree that a button bar makes more sense. But that assumes that you are using a new enough version that button bars are an option, but even two regular buttons side by side might be used here.

                    1 of 1 people found this helpful
                    • 8. Re: Preventing Slide from reverting to slide 1 after leaving and returning to layout
                      lindseym

                      So... after fighting the slides a little more.. and seeing most of you talk about button bars... I went that route.

                       

                      Works seamless. I did have to set up a calculate to set the active segment-- but that worked out easy too.

                       

                      Thanks for the tip arjen.evertse to set in case of nothing.

                       

                       

                      Specifying the active segment of a button bar with a calculation | FileMaker

                      Specifying the active segment of a button bar with a calculation

                       

                      Answer ID: 14542

                      Products
                      • FileMaker Pro
                      •    16.x
                      •    15.x
                      •    14.x
                      • FileMaker Pro Advanced
                      •    16.x
                      •    15.x
                      •    14.x

                       

                      Introduced in FileMaker Pro 14, a button bar is a layout object that displays buttons and / or popover buttons in a horizontal or vertical bar.  Button bars contain segments that represent individual buttons consisting of any combination of a button icon and a text label.When you create a button bar there are many options you can configure to customize the look and feel of the button bar, including:

                      • How many segments (buttons) the button bar will display / have.
                      • The orientation of the button bar
                      • How you want the labels to appear on all buttons in the button bar
                      • The action / script each segment will perform
                      • The active segment - the segment that will by default by the active display state in Browse and Find modes.
                      For more information on configuring a button bar, click hereWhen specifying the active segment you have a choice between specifying an individual segment, specify a calculation for the active segment, or having no active segment at all.ImageChoosing "Specify" allows you to create a calculation to determine the active segment.  If you choose to write a calculation, keep in mind that the segments are not referenced by their "names" (the names that are displayed for each segment) but are referenced by object names.  To name individual segments of a button bar, follow these steps:
                      1. Open the Inspector and click the Position tab
                      2. In Layout mode, select one of the segments of the button bar.
                      3. In the Position area, type a value for Name
                      4. Press Enter or Tab, or click outside the Inspector to apply the changes.

                      For additional information about naming objects in FileMaker Pro, click here

                      Once you have the segments of the button bar named, you can references the objects names in calculations to specify the active segment.  For example...

                      Say you have a two (2) segment button bar with segment names of "Events" and "Contacts", and a text field named "Actions."  You would like the active segment of the button bar to be based on the data in the Actions field.  A calculation for specify the active segment might look something like:

                      Case ( ExampleTable::Actions = "Events" ; "Events" ; "Contacts")