Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
akeswani
Creator
Creator

GetLayout method not returning selections

Hello,

I am using Angular4, and trying to get selections on QS app.

This is how I am calling createsessionobject first:

return new Promise((resolve, reject) => {
        var createSessionSelectionMsg = {           
           "jsonrpc": "2.0",            
           "id": 2,
           "method": "CreateSessionObject",
           "handle": parseInt(handle),
           "params": [
              {
             "qInfo": {
             "qId": "",
             "qType": "SessionLists"                   
              },     
               "qSelectionObjectDef": {}
              }
            ]
} .........

after that I am calling GetLayout

return new Promise((resolve, reject) => {

   var glayout = {

   "jsonrpc": "2.0",

  "id": 2,

  "method": "GetLayout",

  "handle": 2 ,//parseInt(handle),

   "params": []

}

...

The above two returns this result--

result:
qReturn:
   qGenericId: "13f471d2-ee35-480d-a965-a98d783abbc2"
   qGenericType: "SessionLists"
   qHandle: 2
   qType: "GenericObject"

result:

qLayout:

qInfo: {qId: "13f471d2-ee35-480d-a965-a98d783abbc2", qType: "SessionLists"}

qSelectionInfo:{ }

qSelectionObject: {qBackCount: 0, qForwardCount: 0, qSelections: Array(0)}

I am selecting a field value on the app, but the qSelections is not returning anything, don't know why.

am I calling the above correctly?

Can anyone please help me ?

Thanks!

10 Replies
akeswani
Creator
Creator
Author

marking it as correct answer ,as that was the initial problem.

For anyone interested in knowing the solution of further problems I was having with GetField and SelectValues not working for numeric fields, I came to know that the way Qlik works is that it creates list object on those fields behind the scenes. So ,instead of calling GetField and SelectValues, I am now calling CreateObject (the field is created as ListObject), and then GetListObjectData (to get all the values of that field), and then matching the selected values in that list returned and passing on to SelectListObjectValues to get it selected. At the end, just CreateSessionObject and GetLayout methods to display the selections. That made my selections applied on the screen when user clicks the link (which has selections passed in it).