Jump to content

Hover triggers merge variable update ... by itself


LaRetta

This topic is 4019 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I am using ExecuteSQL() to gather values and display them as merge variable on buttons.  If we attach a button to them, they re-evaluate just by hovering over them (please see attached file).  This is new file created for this purpose and I have replicated it in other files as well.

 

The top right grey buttons switch to the correct value as you make changes to the checkbox but then when you hover, the merge variables revert to the prior value.  I've solved it (potentially) by using a separate transparent button over them.  If the button is separate, the value will not revert.  It is only when the button itself has a script attached and you hover on it that the value reverts (only once).   I cannot figure out how to make it NOT revert except with separate button.

 

To me, the hover and conditional formatting merge variable should NOT be interacting.

 

Now this may not be the best process.  But this is the best example of what I am experiencing.  Change a value in the checkbox and you will see the number 1 properly change.  Then hover over the number '1' again and it will revert and STAY reverted until you refresh again.  Very annoying.

 

The thing is ... you will see I am desperately trying to force a refresh but that isn't the issue.  It DOES REFRESH quite fine.  But when hovered, it re-evaluates using the old value.

ConditionalTriggered.zip

  • Like 3
Link to comment
Share on other sites

That IS weird...

 

When you use global variables ($$) instead of local ones ($) it all seems to work fine.  But when using those local variables the hover action does make the layout show the old value, not the current value.

 

The variables are set through a conditional format, and they update fine when the data changes.  The hover does seem to interfere with how the value of the variable is displayed.  The data does not change so there is no reason for the value to change.

  • Like 1
Link to comment
Share on other sites

Thank you, Wim. 

 

It seems that tooltip ( when attached to the button with $1 ) displays the old value as well and in Data Viewer it appears to be confirmed ... $1 stays on 4 ( old value ) even when the button changes to 5 and it is refreshed repeatedly.  When tooltip then hovers, it looks to $1 and uses its value of 4.

 

The hover forces re-evaluation of the button (it should not) so $1 is referenced again and changes its value from 5 to 4 (from the hover).  It might have to do with layering and which layer the objects are on but changing stacking order, placing text object ('I declare variables') in footer or under the object to be refreshed makes no difference. 

 

We need to provide FM with confirmed results from different OS and version so I would appreciate responses.  We really want to understand!  This subtly might affect us in other areas yet unidentified.  Under the hood is important ... whether identifying a bug, unexpected behavior, or simply pinning down the underlying principle so we can use the information.

 

Wow ... another great opportunity to peek deeper into FM.

 

Added:  BTW, the requirement was to provide these calculations to all layouts even if unrelated and I did not want to add table occurrences throughout just to pass the calculation so by using conditional formatting and ExecuteSQL(), it seems to work nicely now that I've changed the variables from $ to $$ thanks to Wim's suggestion.

Edited by LaRetta
Link to comment
Share on other sites

It seems to be related to the Refresh Window script step. I tried replacing it with a Freeze Window and it works. It seems it may have to do with the order of evaluation when using the refresh step verses freeze window in combo with the evaluation when performing the hover state.

 

It works even if i use

Refresh

Freeze Window

 

However, reversing the order of

Freeze Window

Refresh

 

does not.

  • Like 1
Link to comment
Share on other sites

Indeed Wim it does. Granted if you remove the styling from the button, since the conditional formatting on the button is not triggered, it works fine.

Link to comment
Share on other sites

  • 4 weeks later...

This topic is 4019 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.