Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
cpalbrecht
Creator
Creator

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:

SSE_communication_flow.png

But when I am calling this method via a button, the calculation is not triggered. Does anybody now holw to trigger the evaluation with client side JavaScript code?

Thanks for helping me!

BR

Labels (1)
2 Replies
Anonymous
Not applicable

Hi,

I'm not an API expert but I would suggest looking at the engine API. Maybe this method will do the trick: http://help.qlik.com/en-US/sense-developer/November2017/Subsystems/EngineAPI/Content/Classes/AppClas...

Anonymous
Not applicable

Hi Christoph!

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:

Image.png

The vSSE variable was created in before-hand and the full expression looks like this:

Image2.png

To visualize the variable being updated I added a KPI object on the same sheet with $(vSSE) as the expression.

Let me know how it goes!

Kind regards,

Josefine