Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Madeleine
Partner - Contributor
Partner - Contributor

selectionState API not updating on time

Hi, I implemented a Mashup. The underlying Qlik Sense App uses alternate States. I want to display the selections. As far as I know the getList method for the SelectionObject doesn't give me the data for alternative states, that's why I'm using the selectionState method(app.selectionState(alternatestate).selections). The problem is that the output isn't updating on time. For example when I do a selection in field A then the selections aren't updating. Then I select something in another field and my selection list shows the selections for field A. The new selections aren't displayed. I implemented a function in the controller to get the selection. Have I implemented the function at the wrong place or is there another method to get the selections for alternate states?
1 Solution

Accepted Solutions
Aiham_Azmeh
Employee
Employee

Hi @Madeleine ,

Are you binding a listener? ex:

const selState = app.selectionState(alternateState);
const listener = function() {
  console.log(selState);
};
selState.OnData.bind( listener ); //bind the listener

Could you post a code snippet so we can better understand the issue?


View solution in original post

2 Replies
Aiham_Azmeh
Employee
Employee

Hi @Madeleine ,

Are you binding a listener? ex:

const selState = app.selectionState(alternateState);
const listener = function() {
  console.log(selState);
};
selState.OnData.bind( listener ); //bind the listener

Could you post a code snippet so we can better understand the issue?


Madeleine
Partner - Contributor
Partner - Contributor
Author

Thanks a lot 🙂 now it works, the data binding part was missing.