Skip to main content
Announcements
The way to achieve your own success is the willingness to help somebody else. Go for it!
cancel
Showing results for 
Search instead for 
Did you mean: 
sanekagr2
Partner - Contributor II
Partner - Contributor II

Get current selections in Nebula.js

Hi all,

How to get current selections in real time in Nebula.js, in Capability API I can use app.getList('SelectionObject',callback). Is there some alternative in Nebula?

Thanks in advance

 
Labels (3)
1 Solution

Accepted Solutions
rankassovitz
Employee
Employee

Hello @sanekagr2 ,

Capability API is a bit more robust than Nebula. Nebula is only used for embedding Qlik objects. For everything that is outside of actually embedding (session management, hyperCubes, lists, passing selections, evaluating expressions etc.), you will need to directly interact with the QIX engine, via Enigma.js .

To get currentSelections the "Engima" way, you'll need to use the "CreateSessionObject" method and pass the "qSelectionObjectDef" object definition:

 

const selectionObj = await enigmaApp.createSessionObject({
 "params": [
      {
        "qInfo": {
          "qType": "CurrentSelection"
        },
        "qSelectionObjectDef": {}
      }
 ]
});
const selections = await selectionObj.getLayout();
console.log(selections);

 

 

Hope it helps

View solution in original post

6 Replies
rankassovitz
Employee
Employee

Hello @sanekagr2 ,

Capability API is a bit more robust than Nebula. Nebula is only used for embedding Qlik objects. For everything that is outside of actually embedding (session management, hyperCubes, lists, passing selections, evaluating expressions etc.), you will need to directly interact with the QIX engine, via Enigma.js .

To get currentSelections the "Engima" way, you'll need to use the "CreateSessionObject" method and pass the "qSelectionObjectDef" object definition:

 

const selectionObj = await enigmaApp.createSessionObject({
 "params": [
      {
        "qInfo": {
          "qType": "CurrentSelection"
        },
        "qSelectionObjectDef": {}
      }
 ]
});
const selections = await selectionObj.getLayout();
console.log(selections);

 

 

Hope it helps

Jeffrey_Goldberg
Employee
Employee

 @rankassovitz suggested the correct approach. This is the way.

sanekagr2
Partner - Contributor II
Partner - Contributor II
Author

Thank you for the fast response, I will try this solution.

sanekagr2
Partner - Contributor II
Partner - Contributor II
Author

Maybe you know some example of using Enigma.js in Angular application?

rankassovitz
Employee
Employee

Here's a good open source Angular.io example:

https://github.com/yianni-ververis/nebula-angular

- look at globals.ts, you'll see how he authenticated (to a saas tenant) and got his enigma app (doc). 

 

For more, framework agnostic, enigma.js examples check here:
https://github.com/qlik-oss/enigma.js/tree/master/examples 

 

 

 

sanekagr2
Partner - Contributor II
Partner - Contributor II
Author

Thanks.  Your solution worked:


    const selectionObj = await app.createSessionObject({
      "qInfo": {
        "qType": "CurrentSelection"
      },
      "qSelectionObjectDef": {}

    }).then((model) => model);

    selectionObj.getLayout().then((layout) => {
      console.log('selectionObj', layout);
    });

 


Do you know the way to get the real time selection change  indication in Enigma?