Use Background Loading for Widgets in Your Analytic Applications
Optimize the performance of analytic applications with background loading of widgets.
With the background loading of widgets you can improve the startup performance of analytic applications that contain invisible widgets. When you start your application, all widgets (both set as visible or invisible) are initialized before the application starts.
When we talk about invisible widgets, we talk about widgets with the property Show this item at view time switched off but also about widgets inside invisible panels or on tabs in tabstrips that are not active at startup.
The background loading increases the perceived startup performance of the application as the startup screen appears faster.
How to change the Default Behavior
To improve the performance and change the standard behavior, choose in the Edit Analytic Application ( ) menu .
Using the URL Parameter loadInvisibleWidgets
-
loadInvisibleWidgets=onInitialization
This forces the classical behavior and loads all widgets on initialization before the widget shows up.
-
loadInvisibleWidgets=inBackground
This forces the background loading of invisible widgets after the initial visible widgets have shown up for the application user.
Advanced Background Knowledge and Tips
-
Let the Load Invisible Widgets in Background event script empty.
-
If step 1 is not possible, try to avoid accessing widgets that are not initially visible and, above all, don't use the setVariableValue API if it's not needed. If you want to set a variable initially to a static value, save the variable value state to design time with the application instead.
-
If you need to prepare invisible widgets via scripting, do this directly before the widget becomes visible (by calling setVisible(true) or changing the tab in tabstrip) instead of doing this inside the onInitialization event script.
-
If you can't avoid accessing an invisible widget inside the onInitialization event script, don't nest this widget too deep into a container structure like panels or tabstrips. Ideally, this widget is a direct child of the canvas.