5 Replies Latest reply on Sep 24, 2012 4:37 PM by philmodjunk

    Newbie questions

    jb362

      Title

      Newbie questions

      Post

           I have used the inspector to name two buttons and a text label on a a layout.

           Button A is used for showing all records and the button B does filtering.

           Is it possible to hide/disable button A when button B is clicked and vise versa?

           Secondly, to chance the context of the named label, on the fly, which displays “All” or “Filtered” depending which button has been clicked?

           I don't see any script(s) which could accomplish this.

           Thanking you in advance.

            

            

        • 1. Re: Newbie questions
          philmodjunk

               The script for button A can set a global variable:

               Set Variable [$$ButtonBDisable ; value: True ]

               The script for ButtonB can be enclosed in this If step:

               If [Not $$ButtonBDisable ]

                  #Put your script steps here

               End If

               Your layout text can be replaced with a variable or global field. Your script can then use Set Variable, or Set Field to change the content of ths field or variable to display different text.

               Note that none of this requires using the inspector to give layout objects object names.

               You can use conditional formatting to display the button's text in grey when $$ButtonBDisable is True to give it a "disabled" look. You can also use one of the tricks in this demo file to make it disappear altogether:

          https://www.dropbox.com/s/8levaz6deiyzjr8/LayoutObjectVisibilityControlDemo.fp7

          • 2. Re: Newbie questions
            jb362

                 Phil:

                 I managed to get the text to display accordingly.

                 I'm not understanding what is being done to make a button disappear per the demo file.

                 Could you please be more specific?

                 Thanks.

                  

                  

                  

            • 3. Re: Newbie questions
              philmodjunk

                   The demo file illustrates several options for making a button disappear.

                   Were you able to open the file? What option do you want to try to use to make your button disappear?

                   Conditional Formatting? (button must be strictly a text object and the code must still include the If step to keep anything from happening if the button get's clicked even though it is not visible.)

                   Invisible Tab contorl?

                   Portal?

              • 4. Re: Newbie questions
                jb362

                     Phil:

                     I was able to open and convert the demo to FMP12.

                     I've spent the last hour trying to understand the subtlities of the demo.

                     I just don't understand how clicking the check box in the top example causes the left button to disappear.

                     Could you please be more specific?

                     Thanks

                • 5. Re: Newbie questions
                  philmodjunk

                       I can easily be more specific, but I need a specific question--such as you have just posted in order for me to do that.wink
                       The thing to do with a demo file is to take it apart and see how it works.

                       In the case of this demo file, the documentation provided right on the layout tells you that a conditional format was used. That's a term you can look up in FileMaker Help or any training materials you might have to learn more. If you change to layout mode, you can right-click each of the objects to the right of the check box field and select conditional Formatting... to open a dialog where you can see and explore the different conditional format expressions. If you double-click the check box field or just click it and check the "display data from" box in the Inspector, you'll see that the name of this check box field is called "LayoutObjectVisibilityControlDemo::Show1" where the first part of the name is the table in which it is defined and "Show1" is the name of the field in that table. You can also check the settings for the check box on the inspector's data tab to see the name of the value list and thus what value is actually entered into this check box field when it is selected.