Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi qlik devs!
I want to build a mashup with several apps. These apps have some common fields used as dimension (Country, Product family....).
I want selections made on these fields to be applied to all the apps used by the mashup.
Has anyone done this kind of things?
I guess it can be done using
app.getList("CurrentSelections", .....
To listen to selection change, and then applying these to all apps. Probably using some buffer to store last state and trigger selections on change in order to avoid infinite loops.
I'd be glad to have some thoughts and feedback on this.
Martin
Hi Martin,
I have done some work on this. Some recommendations:
- use one app as a master app, where the user makes selections in the common fields
- listen to the selections with List objects, created with createList
- propagate the selections to the other apps with field.select
Hope you find this helpful
Erik Wetterberg
What you are suggesting sounds viable, although I have never tried it.
What I generally do for a mashup is a create dedicated qvf app for it. So maybe you could create a single qvf app that contains the data your mashup needs, as opposed to trying to sync several qvf data source apps. This may sound a bit of a palaver but I reckon would be quicker to do and end up with a more efficient and reliable mashup.
Hi Martin,
I have done some work on this. Some recommendations:
- use one app as a master app, where the user makes selections in the common fields
- listen to the selections with List objects, created with createList
- propagate the selections to the other apps with field.select
Hope you find this helpful
Erik Wetterberg
Hi,
Thanks again for the tips!
Using the createList method was clearly a better idea than dealing with the whole CurrentSelections object.
In the end I only had to propagate selections on a defined user action so I used createList to get selections, field.select to apply them and destroyed the list object in the end.
Martin
Hi Martin/Erik,
Can you share the code of how you achieved this? I am new to coding and trying to build process that applies the selections from one mashup to another.
Thanks,
Sri