<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Selections get reset when switching apps in a mashup in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Selections-get-reset-when-switching-apps-in-a-mashup/m-p/1623410#M11292</link>
    <description>&lt;P&gt;Could it be that your session in the first app is closing when switching to the second app?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Sep 2019 19:05:01 GMT</pubDate>
    <dc:creator>treysmithdev</dc:creator>
    <dc:date>2019-09-12T19:05:01Z</dc:date>
    <item>
      <title>Selections get reset when switching apps in a mashup</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Selections-get-reset-when-switching-apps-in-a-mashup/m-p/1617701#M11185</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;I have a simple mashup that I created to test out the selection model, using Angular JS.&amp;nbsp;I have attached my code, along with my sample "apps", pardon the crude code as I am still just trying things out.&lt;/P&gt;&lt;P&gt;&lt;U&gt;What do I want to do?&lt;/U&gt;&lt;/P&gt;&lt;P&gt;I want to apply selections between two apps when I switch back and forth between them.&lt;/P&gt;&lt;P&gt;&lt;U&gt;What did I do to make it happen?&lt;/U&gt;&lt;/P&gt;&lt;P&gt;when I select a value, I store it in the localStorage, when I switch an app, I retrieve it from the localStorage and use field.selectValues to set the values.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;me.qapp.getList("SelectionObject", function(reply) {
					console.log(reply.qSelectionObject.qSelections);
					localStorage.setItem("dashboardSelection", JSON.stringify(reply.qSelectionObject.qSelections))
					//me.store();
				});&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;promiseArray.push(fld.selectValues( valArray, true, true ));&lt;/LI-CODE&gt;&lt;P&gt;&lt;U&gt;What actually happens?&lt;/U&gt;&lt;/P&gt;&lt;P&gt;when I switch to the second app, the values get selected, but when I switch back to the original app, it gets reset.&lt;/P&gt;&lt;P&gt;From the bind, I can see it getting triggered to set it to empty after the select values are completed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the promises wherever a function returns one, and q.all to wait for. I even introduced app.lockAll and app.unlockAll to act as a trigger mechanism for setting the values.&lt;/P&gt;&lt;P&gt;I even introduced waitForOpen&amp;nbsp;to see if it would help with the timing.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;app.model.waitForOpen.promise.then&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;AG&lt;/P&gt;&lt;P&gt;&lt;FONT size="5"&gt;Console Log&lt;/FONT&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;my-angular-module.js:140 S {fieldCache: {…}, stateCache: {…}, qEvent: t, close: ƒ, id: "1d0e9665-1a42-41ca-bd4c-4552fdff4dc7", …}
my-angular-module.js:143 App {_super: undefined, rpcOptions: {…}, session: d, waitForOpen: u, notification: ƒ, …}
my-angular-module.js:145 apply selections
my-angular-module.js:40 []
my-angular-module.js:72 []
my-angular-module.js:78 []
my-angular-module.js:78 [{…}]


my-angular-module.js:112 n {OnData: n, qapp: S, selections: Array(0), stateName: "$"}
my-angular-module.js:115 []
my-angular-module.js:140 S {fieldCache: {…}, stateCache: {…}, qEvent: t, close: ƒ, id: "1ff9edf1-9815-451f-8ff6-e23a3a21eb11", …}
my-angular-module.js:143 App {_super: undefined, rpcOptions: {…}, session: d, waitForOpen: u, notification: ƒ, …}
my-angular-module.js:145 apply selections
my-angular-module.js:40 [{"qTotal":5,"qField":"COl1","qSelectedCount":1,"qSelected":"A","qRangeInfo":[],"qSortIndex":0,"qStateCounts":{"qLocked":0,"qSelected":1,"qOption":0,"qDeselected":0,"qAlternative":4,"qExcluded":0,"qSelectedExcluded":0,"qLockedExcluded":0},"qSelectedFieldSelectionInfo":[{"qName":"A","qFieldSelectionMode":"NORMAL"}],"qNotSelectedFieldSelectionInfo":[],"qSelectionThreshold":6}]
my-angular-module.js:59 ["A"]
my-angular-module.js:72 []
my-angular-module.js:78 [{…}]


my-angular-module.js:112 n {OnData: n, qapp: S, selections: Array(1), stateName: "$", …}
my-angular-module.js:115 [e]
my-angular-module.js:140 S {fieldCache: {…}, stateCache: {…}, qEvent: t, close: ƒ, id: "1d0e9665-1a42-41ca-bd4c-4552fdff4dc7", …}
my-angular-module.js:143 App {_super: undefined, rpcOptions: {…}, session: d, waitForOpen: u, notification: ƒ, …}
my-angular-module.js:145 apply selections
my-angular-module.js:40 [{"qTotal":5,"qField":"COl1","qSelectedCount":1,"qSelected":"A","qRangeInfo":[],"qSortIndex":0,"qStateCounts":{"qLocked":0,"qSelected":1,"qOption":0,"qDeselected":0,"qAlternative":4,"qExcluded":0,"qSelectedExcluded":0,"qLockedExcluded":0},"qSelectedFieldSelectionInfo":[{"qName":"A","qFieldSelectionMode":"NORMAL"}],"qNotSelectedFieldSelectionInfo":[],"qSelectionThreshold":6}]
my-angular-module.js:59 ["A"]
my-angular-module.js:72 []
my-angular-module.js:78 []&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 20:11:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Selections-get-reset-when-switching-apps-in-a-mashup/m-p/1617701#M11185</guid>
      <dc:creator>amit_ghaste</dc:creator>
      <dc:date>2024-11-16T20:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: Selections get reset when switching apps in a mashup</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Selections-get-reset-when-switching-apps-in-a-mashup/m-p/1623410#M11292</link>
      <description>&lt;P&gt;Could it be that your session in the first app is closing when switching to the second app?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2019 19:05:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Selections-get-reset-when-switching-apps-in-a-mashup/m-p/1623410#M11292</guid>
      <dc:creator>treysmithdev</dc:creator>
      <dc:date>2019-09-12T19:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Selections get reset when switching apps in a mashup</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Selections-get-reset-when-switching-apps-in-a-mashup/m-p/1683369#M12466</link>
      <description>&lt;P&gt;I found the answer for this.&lt;/P&gt;&lt;P&gt;it has to do with&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;fld.selectValues( valArray, true, true )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;should instead be&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;fld.selectValues( valArray, false, true )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;For some reason, the toggle attribute does not seem to work as I was expecting it too.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2020 15:36:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Selections-get-reset-when-switching-apps-in-a-mashup/m-p/1683369#M12466</guid>
      <dc:creator>amit_ghaste</dc:creator>
      <dc:date>2020-03-10T15:36:38Z</dc:date>
    </item>
  </channel>
</rss>

