4 Replies Latest reply on Feb 16, 2015 3:05 PM by TSGal

    GetLayoutObjectAttribute does not reflect displayed data before refresh

    jbante

      Summary

      GetLayoutObjectAttribute does not reflect displayed data before refresh

      Product

      FileMaker Pro

      Version

      ProAdvanced 13.0v5

      Operating system version

      10.10.2

      Description of the issue

      When a script sets variables that appear in a layout as merge variables, the GetLayoutObjectAttribute "content" result reflects the variables set by the script, even though the un-refreshed result on the layout does not match.

      Steps to reproduce the problem

      Place a merge variable on a layout, set a value to that variable, and refresh the layout without a script. Create a script that sets a different value to the variable, attempts to retrieve the displayed merge variable content with the GetLayoutObjectAttribute function *before* refreshing the layout, and show the result.

      Expected result

      The result of the GetLayoutObjectAttribute function running in the script should reflect the contents of the object as they currently appear in the layout.

      Actual result

      The result of the GetLayoutObjectAttribute function reflect what the displayed content would be after a refresh.

      Exact text of any error message(s) that appear

      n/a

      Configuration information

      Demo file: https://www.dropbox.com/s/7pidjdjt3511m84/GetLayoutObjectAttribute%20Bug.fmp12.zip?dl=0

      Workaround

      None.

        • 1. Re: GetLayoutObjectAttribute does not reflect displayed data before refresh
          TSGal

          Jeremy Bante:

          Thank you for your post.

          Although I am able to replicate the issue with your sample file, my first thought is how this would affect existing solutions who are changing the value and expecting this result.  Regardless, I have sent your post and file to our Development and Testing departments for review.  When I receive any feedback, I will let you know.

          TSGal
          FileMaker, Inc.

          • 2. Re: GetLayoutObjectAttribute does not reflect displayed data before refresh
            TSGal

            Jeremy Bante:

            Development and Testing confirm this is "as designed".  The value has been changed, although not updated by a refresh.  Development would like to know why you want the data from the unrefreshed layout instead of the real data?

            TSGal
            FileMaker, Inc.

            • 3. Re: GetLayoutObjectAttribute does not reflect displayed data before refresh
              jbante

              From the perspective of FileMaker developers, who are not generally burdened with the difference between the graphics buffer and what appears on screen, it's more intuitive to think of what actually appears on screen as the current state of layout objects than the otherwise invisible value that does not appear until a refresh. There are plenty of examples in software development of disconnects between what-appears-to-be and what-is, but such behavior is inconsistent with our expectations for FileMaker. (Granted, once you switch layouts or records in a frozen window, all bets are off, and rightly so!)

              One more specific scenario where this issue came up was in trying to write a script that can retrieve data from local $variables set in the layout by a "Hide Object When..." calculation. Such variables continue to display their contents in merge variables as long as the script doesn't refresh anything, but values from before the start of script execution appear to exist in a scope that is inaccessible from the script. So we hoped GetLayoutObjectAttribute would be able to retrieve the data that was still appearing on-screen after script execution started.

              • 4. Re: GetLayoutObjectAttribute does not reflect displayed data before refresh
                TSGal

                Jeremy Bante:

                Thanks for the explanation.  I have sent this back to the developer for review/consideration.

                TSGal
                FileMaker, Inc.