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

Bookmarks don't work/save in mashup

Hi everyone,

I am trying to make a mashup that allows users to create and use bookmarks. Unfortunately it doesn't work when I test it on Qlik Sense Desktop April 2019. The problem is that the bookmarks don't get saved and disappear when you refresh the page.

My code is based on the standard Grid mashup template:
Q1.PNG

This looks like this (I added the app consumer sales and an object):
Q2.PNG
In this mashup I do the following:
- Click "Bookmarks";
- Click "Create";
- Fill in a title and description -> click "Create";

This results in a bookmark called "This doesn't save":
Q3.PNG 

Problem is, when I refresh the page I don't see my bookmark anymore:
Q4.PNG
I also checked the qBookmarkList where you normally find the bookmarks and they are empty:
qBookmarkList{qItems: Array(0)}

The strange thing is, sometimes it does work and the bookmarks persist even when I refresh or restart my PC. Can anyone help me understand why this doesn't work (and sometimes does?)

Thanks in advance

Labels (3)
1 Solution

Accepted Solutions
ErikWetterberg

Hi,

If you try creating two bookmarks with that code, is the first one saved?

The problem might be that you don't wait for the bookmark.create before saving. In that case try something like this:

app.bookmark.create( title, desc ).then(function(){

    app.doSave();

});

But of course there might be another problem.

View solution in original post

4 Replies
ErikWetterberg

Hi,

In Qlik Sense Desktop you need to save the app, since that's where the bookmark is saved.

cpomeren003
Partner - Creator II
Partner - Creator II
Author

Hi Erik,

Thanks for the quick reply. I tried saving the app, but it doesn't work. I used it like this:

case 'createBm':
var title = $( "#bmtitle" ).val(), desc = $( "#bmdesc" ).val();
app.bookmark.create( title, desc );
$( '#createBmModal' ).modal( 'hide' );
//In Qlik Sense Desktop you need to save the app, since that's where the bookmark is saved.
app.doSave();
break;

It didn't do anything as far as I can see and I also don't get any errors in the console.

ErikWetterberg

Hi,

If you try creating two bookmarks with that code, is the first one saved?

The problem might be that you don't wait for the bookmark.create before saving. In that case try something like this:

app.bookmark.create( title, desc ).then(function(){

    app.doSave();

});

But of course there might be another problem.

cpomeren003
Partner - Creator II
Partner - Creator II
Author

Brilliant, it works!

I also used it when I delete my bookmarks, like this:

app.bookmark.remove(bookmarkId).then(function() {
app.doSave();
});

This also works. Thanks for all the help, really appreciate it!