Skip to main content
Announcements
Marching toward a simplified navigation! READ ON
cancel
Showing results for 
Search instead for 
Did you mean: 
markginqo
Partner - Contributor III
Partner - 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
Aiham_Azmeh
Employee
Employee

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,

View solution in original post

6 Replies
pathiqvd
Creator III
Creator III

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,

Aiham_Azmeh
Employee
Employee

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
Partner - Contributor III
Partner - Contributor III
Author

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

markginqo
Partner - Contributor III
Partner - Contributor III
Author

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

Cheers,

Mark

pentaxadmin
Partner - Creator
Partner - Creator

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

Branislav

rajeshvartak
Contributor II
Contributor II

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


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