Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Tool_Tip
Creator III
Creator III

Session expired mashup page

Dear all,

 

We have created single mashup page wherin we have used whole sheet as single object.

Mashup is running good but after 30 min we are getting session expired message due to inactivity in qliksense.

How can we keep session live on mashup page? For trial purpose we have added clock object as running on mash up page where clock is running fine but area on html page where we have kept sheet object shows session expired.

Kindly advise some solution. [ I am not expecting solution as to keep every single object from sheet on html page it takes too much customization which I do not want]

Labels (1)
3 Replies
paulcalvet
Partner - Specialist
Partner - Specialist

Hello,

You can create a loop that do selections in your mashup.

In the js, create a function that loop every n seconds :

function globalLoop(num, Country, Country2, nbBoucle) {
 
var intervalIDGlobal = window.setInterval(globalLoopInterval, 3000); // repeat every 5 seconds
 
function globalLoopInterval() {

app.field('Country').selectValues([{qText: Country}], false, true);}

 

 

And in the $(document).ready(function() you call this function :

$(document).ready(function(){

var num = 0;
var numCountry = Math.floor(Math.random() * 5);
var numFood = 0;
var nbBoucle = 1;

do {
var numCountry2 = Math.floor(Math.random() * 5);
}
while (numCountry == numCountry2);

var arrCountry = ["FRANCE","BELGIUM","GERMANY","ITALY","SPAIN","GREAT BRITAIN"];
var Country = arrCountry[numCountry];
var Country2 = arrCountry[numCountry2];

// Initialisation des sélections
app.field('Country').clear();
app.field('Country').selectValues([{qText: arrCountry[numCountry]}], false, true);

// Initialisation des images
document.getElementById('idsquare-2-1').style.backgroundImage = 'url(./img/FOODNOFOOD.png)'
document.getElementById('idsquare-3-1').style.backgroundImage = 'url(./img/offlineonline.png)'

globalLoop(num, Country, Country2, nbBoucle);

 

 

Tool_Tip
Creator III
Creator III
Author

Dear paul,

Thank you for your response. Below is my js script, can you please where I can write given code :

var prefix = window.location.pathname.substr( 0, window.location.pathname.toLowerCase().lastIndexOf( "/extensions" ) + 1 );
var config = {
host: window.location.hostname,
prefix: prefix,
port: window.location.port,
isSecure: window.location.protocol === "https:"
};
require.config( {
baseUrl: ( config.isSecure ? "https://" : "http://" ) + config.host + (config.port ? ":" + config.port : "") + config.prefix + "resources"
} );
 
require( ["js/qlik"], function ( qlik ) {
qlik.on( "error", function ( error ) {
$( '#popupText' ).append( error.message + "<br>" );
$( '#popup' ).fadeIn( 1000 );
} );
$( "#closePopup" ).click( function () {
$( '#popup' ).hide();
} );
 
//callbacks -- inserted here --
//open apps -- inserted here --
var app = qlik.openApp('xcxxcxc-c1d0-44a1-9a7f-474b9cfaebda', config);
 
//get objects -- inserted here --
    app.getObject('QV13','gmKELV'); // Month filter
app.getObject('QV12','armMR');  // Year filter
app.getObject('QV11','RTwJE');
app.getObject('QV10','JwCUk');
app.getObject('QV09','bneKQr');
app.getObject('QV08','pGrLeJ');
app.getObject('QV07','vfXNw');
app.getObject('QV06','KmDymm');
app.getObject('QV05','bkJFpdZ');
app.getObject('QV04','cEWmFK');
app.getObject('QV03','WjgUc');
app.getObject('QV02','hpDmz');
app.getObject('QV01','rkhKzkR');
 
 
 
 
//create cubes and lists -- inserted here --
 
} );
 
// Calling showTime function at every second
setInterval(showTime, 1000);
 
// Defining showTime funcion
function showTime() {
    // Getting current time and date
    let time = new Date();
    let hour = time.getHours();
    let min = time.getMinutes();
    let sec = time.getSeconds();
    am_pm = "AM";
 
    // Setting time for 12 Hrs format
    if (hour >= 12) {
        if (hour > 12) hour -= 12;
        am_pm = "PM";
    } else if (hour == 0) {
        hr = 12;
        am_pm = "AM";
    }
 
    hour =
        hour < 10 ? "0" + hour : hour;
    min = min < 10 ? "0" + min : min;
    sec = sec < 10 ? "0" + sec : sec;
 
    let currentTime =
        hour +
        ":" +
        min +
        ":" +
        sec +
        am_pm;
 
    // Displaying the time
    document.getElementById(
        "clock"
    ).innerHTML = currentTime;
}
 
showTime();
Tool_Tip
Creator III
Creator III
Author

Dear Paul,

 

I am still awaiting for your response