5 Replies Latest reply on May 18, 2015 10:17 AM by accfanz

    Refresh Object



      Refresh Object


      I'm having trouble with a very simple refresh object script in FM 13.  I have an object that I have named "button" and have set it to hide if the global variable $$selected_button is empty.  That works.

      A button that has an object name and text inside the button perform the following script but does not work.  What is wrong?

      Set Variable [ $$selected_button ; Value: ( Get Script Parameter ) ]

      Refresh Object [ Object Name: "button" ]


        • 1. Re: Refresh Object

          Exactly how did you name that layout object?

          Exactly how does this script "not work"?

          • 2. Re: Refresh Object

            The button was named in Inspector under the position tab and then name.  I have tried the script with a button, field and text.  It stays hidden like I have told it to under the data tab in Inspector with Hide Object when IsEmpty ( $$selected_button) but when I run the script and set the variable with the script parameter it stays hidden.  I've seen it work in a tutorial this way but can't make mine work.  It looks to me like the variable is not getting set with the value of the script parameter.  The button/object to run the script has been given a name as well so it should be using that name as the value, and then setting the variable which then is not empty so it should no longer be hidden.  I think.

            • 3. Re: Refresh Object

              The button/object to run the script has been given a name as well so it should be using that name as the value,

              That doesn't sound right. How exactly are you using the object name of the button in your script? Many assume that clicking a button puts the focus on the button and thus makes it the current layout object, but this is not the case and may be the source of your trouble. Perhaps the variable's value is not being changed and this is why the Hide Object WHen expression keeps the layout object hidden from view.

              • 4. Re: Refresh Object

                I believe the problem is with the Get Script Parameter value.  If I set the value of the variable to literal text or even something like Layout Number or Current Time, it works.  So I guess it's the Get Script Parameter that I don't quite understand.

                • 5. Re: Refresh Object

                  Problem solved.  I was not using the optional script parameter under the specify script to set the parameter.