3 Replies Latest reply on Jul 17, 2015 7:00 AM by philmodjunk

    "Hide Object" not working as it should with global values

    StevieP

      Title

      "Hide Object" not working as it should with global values

      Post

      I've been wrestling with this problem for ages now. Basically, I have a layout with a Tab Control with three different tabs. What I'd like to do, is hide or show certain elements outside of that Tab Control according to active tab. I created a global value called $$activetab which contains the number of the active tab.

      For the object which I want to hide, I used a simple calculation to hide it when anything but the second tab is selected:

      $$activetab ≠ 2

      According to the data Viewer, this returns value "1" so it works fine yet Filemaker will not hide the object, ever. If I use another expression, it works but Filemaker seems to dislike the use of globalvalues.

      Is there a fix for this? Or could someone verify that this is a bug? Thanks in advance!

        • 1. Re: "Hide Object" not working as it should with global values
          philmodjunk

          Global variables work just fine in Hide Object When expressions, but you sometimes have to "nudge" the object itself to get it to change visibility when the value of the variable is changed.

          Try this:

          Give the object to which you have specified a "Hide Object When" expression an object name in the Inspector.

          In the script that changes the value of the variable, follow that step with a Refresh Object step that specifies the object by name. If you have several objects that all are set up with "hide object when" expressions, you can end up with a series of Refresh Object steps following the set variable step. Or you can group the objects and set the group up with a single object name and one Hide Object When expression.

          • 2. Re: "Hide Object" not working as it should with global values
            StevieP

            Thanks for the answer. This makes sense - seems like Filemaker wants to conserve CPU power by not constantly refreshing. It does make it a bit cumbersome though. Is there no way to refresh everything on the page at once?

            • 3. Re: "Hide Object" not working as it should with global values
              philmodjunk

              Refresh Window will refresh the entire window. Refreshing an object or two is intended as a way to get what you need without having to refresh the entire window--which can in some cases trigger an undesirable delay or "flash" of your window while it redraws.