Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
We can build a widget like this to reload the current Sense app:
<lui-button ng-click="app.doReload(); app.doSave();">Reload</lui-button>
However how can I reload another application? The reload API doesn't have the option to indicate other app's name or ID?
qlik.app.doReload(qMode, qPartial, qDebug)
Can anyone shed any light please?
Cheers
Fei
Hi,
You will need to call the Repository API app reload method.
But I'm not sure that this is possible from a widget, you might be better off with an extension.
Hope this helps
Erik Wetterberg
Thank you very much for your reply.
The help page says app api is working with widget but I don't know how to use it. Can you help me with my widget codes? It doesn't work (all I want to do is set up a reload button to load app id 95c2adae-dfa8-4a5c-9524-118b5cf328d6):
<html>
<script>
var config = {
host: "mydomain.com", //the address of your Qlik Engine Instance
prefix: "/", //the virtual proxy to be used. for example "/anonymous/"
port: window.location.port, //the port to be used if different from the current port
isSecure: true //should be true if connecting over HTTPS
};
require.config({
baseUrl: ( config.isSecure ? "https://" : "http://" ) + config.host + (config.port ? ":" + config.port: "") + config.prefix + "resources",
});
require(['js/qlik'], function(qlik) {
//if there's any error we catch it here
qlik.setOnError( function ( error ) {
console.log(error);
});
});
var app = qlik.openApp("95c2adae-dfa8-4a5c-9524-118b5cf328d6", config);
</script>
<p>
<lui-button ng-click="app.doReload();
app.doSave();">Reload</lui-button>
</p>
</html>
You can't use script tags in widgets (nor in extensions).App API is available, but will work with the current open app. Opening an app with openApp to do a reload isnot a good idea, it will load app data into memory, data that will be replaced when you do the reload.
Erik Wetterberg
Thank you for your reply Erik. Cheers!