GetLayout method doesn't calculate the expressions
I am using server side extension for Java. Everything is working fine. When I am selecting any field e.g. in a table, every expression is calculating new values and the new values are displayed.
Now I want to trigger the evaluation manually e.g. via a button. I have a expression like this javaPlugin.getRandomNumber([num]). So every time the expression is called, the Java plugin returns random numbers based on the input numbers.
The following communication description says, that the evaluation of the expressions are triggered by the GetLayout method:
Re: GetLayout method doesn't calculate the expressions
Are you using the sense-navigation extension as a button? Do you get any call to the plugin at all?
The behavior should not differentiate between different plugins, so I used the python FullScriptSupport example plugin to try the functionality of using a button to set a variable.
I noticed that to get the call to the plugin each time you push the button, you must disable the cache. Either with the DisableCache setting or by sending a header from the plugin to disable the cache (the latter is for the object in question, and the former is ).
Additionally, it's important that you're not including an equal sign in the beginning of the expression, in that case (for both cache enabled and disabled) you will get only one call to the plugin when you save the expression, and no further calls when pushing the button.
In the button extension I added a first action as below:
The vSSE variable was created in before-hand and the full expression looks like this:
To visualize the variable being updated I added a KPI object on the same sheet with $(vSSE) as the expression.