Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

markginqo
New Contributor III

Mashup bookmarks failing in QS June 2017?

Hello,

I'm trying to apply a bookmark in a mashup using the Bookmark API in the QS June 2017 release but there seems to be an error coming from within Qlik's custom javascript...

Steps to reproduce:

  1. Create a new mashup from the dev-hub using the basic template
  2. Select an app that has a bookmark
  3. Edit the javascript file, adding the bookmark.apply() call below the app object creation: bookmark.apply.png
  4. View the mashup & examine the console error messages, the relevant object does not appear to be defined: console.log.png

Is anyone else seeing this issue?

Thanks,

Mark

1 Solution

Accepted Solutions
Employee
Employee

Re: Mashup bookmarks failing in QS June 2017?

Hi markginqo‌,

    The reason why bookmark API is crashing is because the app haven't received yet the model. I will file it as a bug, but until then try this:

var app = qlik.openApp('your_app_id', config);

app.model.waitForOpen.promise.then( function () {

     app.bookmark.apply("your bookmark_id");

});

I hope this helps,

6 Replies
pathiqvd
Contributor III

Re: Mashup bookmarks failing in QS June 2017?

Hi,

Please try this code,

function AppUi ( app ) {

var me = this;

this.app = app;

app.getList( "BookmarkList", function ( reply ) {

var str = "";

reply.qBookmarkList.qItems.forEach( function ( value ) {

if ( value.qData.title ) {

str += '<li><a data-id="' + value.qInfo.qId + '">' + value.qData.title + '</a></li>';

}

} );

//str += '<li><a data-cmd="create">Create</a></li>';

$( '#qbmlist' ).html( str ).find( 'a' ).on( 'click', function () {

var id = $( this ).data( 'id' );

if ( id ) {

app.bookmark.apply( id );

} else {

var cmd = $( this ).data( 'cmd' );

if ( cmd === "create" ) {

$( '#createBmModal' ).modal();

}

}

} );

} );

$( "#qbmlist1" ).on( 'click', function () {

$( '#createBmModal' ).modal();

} );

$( "[data-qcmd]" ).on( 'click', function () {

var $element = $( this );

switch ( $element.data( 'qcmd' ) ) {

case 'createBm':

var title = $( "#bmtitle" ).val(), desc = $( "#bmdesc" ).val();

app.bookmark.create( title, desc );

$( '#createBmModal' ).modal( 'hide' );

break;

}

} );

}

Thanks & Regards,

Employee
Employee

Re: Mashup bookmarks failing in QS June 2017?

Hi markginqo‌,

    The reason why bookmark API is crashing is because the app haven't received yet the model. I will file it as a bug, but until then try this:

var app = qlik.openApp('your_app_id', config);

app.model.waitForOpen.promise.then( function () {

     app.bookmark.apply("your bookmark_id");

});

I hope this helps,

markginqo
New Contributor III

Re: Mashup bookmarks failing in QS June 2017?

Thank you, lakshmipathi, I appreciate you taking the time to make such a detailed response.

markginqo
New Contributor III

Re: Mashup bookmarks failing in QS June 2017?

Thanks aaz‌, much appreciated... you saved me from a downgrade to 3.2.

Cheers,

Mark

bujnakbranislav
Contributor

Re: Mashup bookmarks failing in QS June 2017?

I am having similar issue, thanks for the solution. aaz

Branislav

rajeshvartak
New Contributor

Re: Mashup bookmarks failing in QS June 2017?

I am concerned that the fix is not included in Sep 2017 release too.


Thanks aaz‌ you saved the day...you solution works perfectly.

Community Browser