Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am integrating Qlik Sense using enigma.js and following the related tutorial. This is my code currently :
// Get bookmarks
const bookmarkListModel = await app
.createSessionObject({
qInfo: { qId: "BookmarkList", qType: "BookmarkList" },
qBookmarkListDef: { qType: "bookmark" }
})
.catch(errorHandler);
const bookmarksUpdater = () =>
bookmarkListModel
.getLayout()
.then(layout => (qlikApi.app.bookmarks = layout.qBookmarkList.qItems))
.catch(errorHandler);
// Reactive bookmarks
bookmarkListModel.on("changed", bookmarksUpdater);
await bookmarksUpdater();
The first call to the await bookmarksUpdater(); updates correctly my qlikApi.app.bookmarks variable, however deleting/adding bookmarks does not trigger the event.
I tried :
Do you have any clue on where to search next?
Hi @rmnvncnt , I tested your code and it works on my side. You are managing it in the correct way reacting to changes on your bookmarks list.
//----- React to bookmarks list changes -----
//Create bookmark list
const bookmarkListModel = await app
.createSessionObject({
qInfo: { qId: "BookmarkList", qType: "BookmarkList" },
qBookmarkListDef: { qType: "bookmark" }
})
const bookmarksUpdater = () =>
bookmarkListModel
.getLayout()
.then(layout => console.log("a"))
// Reactive bookmarks
bookmarkListModel.on("changed", bookmarksUpdater);
await bookmarksUpdater();
//Create a bookmark
const bookmarkDef = {
"qInfo": {
"qType": "bookmark"
},
"qMetaDef": {
"title": "Bookmark (1)",
"description": "",
"isExtended": false
},
"creationDate": "2023-03-15T09:21:38.845Z",
"sheetId": "bd37d32a-20c4-47e6-aeea-0838e98e1de2",
"selectionFields": "Date"
}
const bookmarks = await app.createBookmark(bookmarkDef);
//Delete bookmark
await app.destroyBookmark(bookmarks.id);
Hi alex_colombo,
Thank you for testing. We managed to fix this issue.
For posterity, the issue was on the user session : we did not open a websocket session specifically for the app, we simply opened it for the engine and then re-used it for the app.
Link that helped us : https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-server-stuck-at-SESSION-ATTACHED-stage...
Best regards