<?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 Change selection within Custom Extention in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Change-selection-within-Custom-Extention/m-p/920413#M1233345</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TL;DR; How can I make a selection from an Extention or reference a Listbox and use it to make the selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've built a custom pivot table which uses the Product on the x axis, Province on the y axis and a composite key in the cross section. Each cross section cell has a check box which calls a function to select/deselect with the composite key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having trouble making the actual selection, according to the documentation the only methods available to make a selection from an extension is &lt;SPAN style="font-size: 13.3333330154419px;"&gt;SelectTextsInColumn(...)&lt;/SPAN&gt; and &lt;SPAN style="font-size: 13.3333330154419px;"&gt;SelectValuesInColumn(...)&lt;/SPAN&gt; but I cant use either as the composite key isn't within those columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I used SelectTextsInColumn(...) with the Product or Province name, it works fine but I need to use the composite key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've set up a ListBox with the composite keys and I'm trying to get an reference to it and make the selection with SelectTexts(...) but I get and error when I try make the selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've got the following code to test using the GetSelected() function;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14381788988888152" jivemacro_uid="_14381788988888152" modifiedtitle="true"&gt;
&lt;P&gt;window.onRowItemClick = function(box, key) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // -- code removed for brevity --&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var mydoc = Qv.GetCurrentDocument();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(mydoc);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var lb = mydoc.GetObject('LB');&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(lb);&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var selected = lb.Data.GetSelected();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // &amp;lt;--- Object doesn't support property or method 'GetSelected'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(selected);&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run the same code within the Firebug extension, the lb.Data.GetSelection() works fine and returns the array of selected items.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="firebug.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/94430_firebug.jpg" style="height: 370px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;I'm looking for any way to make the selection with my composite key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Jan 2026 16:26:21 GMT</pubDate>
    <dc:creator>organgrindingmo</dc:creator>
    <dc:date>2026-01-26T16:26:21Z</dc:date>
    <item>
      <title>Change selection within Custom Extention</title>
      <link>https://community.qlik.com/t5/QlikView/Change-selection-within-Custom-Extention/m-p/920413#M1233345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TL;DR; How can I make a selection from an Extention or reference a Listbox and use it to make the selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've built a custom pivot table which uses the Product on the x axis, Province on the y axis and a composite key in the cross section. Each cross section cell has a check box which calls a function to select/deselect with the composite key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having trouble making the actual selection, according to the documentation the only methods available to make a selection from an extension is &lt;SPAN style="font-size: 13.3333330154419px;"&gt;SelectTextsInColumn(...)&lt;/SPAN&gt; and &lt;SPAN style="font-size: 13.3333330154419px;"&gt;SelectValuesInColumn(...)&lt;/SPAN&gt; but I cant use either as the composite key isn't within those columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I used SelectTextsInColumn(...) with the Product or Province name, it works fine but I need to use the composite key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've set up a ListBox with the composite keys and I'm trying to get an reference to it and make the selection with SelectTexts(...) but I get and error when I try make the selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've got the following code to test using the GetSelected() function;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14381788988888152" jivemacro_uid="_14381788988888152" modifiedtitle="true"&gt;
&lt;P&gt;window.onRowItemClick = function(box, key) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // -- code removed for brevity --&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var mydoc = Qv.GetCurrentDocument();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(mydoc);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var lb = mydoc.GetObject('LB');&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(lb);&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var selected = lb.Data.GetSelected();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // &amp;lt;--- Object doesn't support property or method 'GetSelected'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(selected);&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run the same code within the Firebug extension, the lb.Data.GetSelection() works fine and returns the array of selected items.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="firebug.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/94430_firebug.jpg" style="height: 370px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;I'm looking for any way to make the selection with my composite key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2026 16:26:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Change-selection-within-Custom-Extention/m-p/920413#M1233345</guid>
      <dc:creator>organgrindingmo</dc:creator>
      <dc:date>2026-01-26T16:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: Change selection within Custom Extention</title>
      <link>https://community.qlik.com/t5/QlikView/Change-selection-within-Custom-Extention/m-p/920414#M1233348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have found the solution which is rather simple. You can only do a selection on dimensions within the Extension using &lt;SPAN style="color: #002ebe; font-family: 'Courier New', Courier, monospace; font-size: 13px;"&gt;&lt;STRONG&gt;SelectTextsInColumn&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #002ebe; font-family: 'Courier New', Courier, monospace; font-size: 13px;"&gt;(Column, toggle, recordsToSelect)&lt;/SPAN&gt;, the Column parameter refers to which dimension you want to select in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All I had to do was add an extra Composite Key Dimension and then select on that Column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ie: SelectTextsInColumn(&lt;STRONG&gt;2&lt;/STRONG&gt;, true, "compKeyValue"); where the 2 refers to the 3rd item in my dimension array.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em;"&gt;0 = product, 1 = province and 2 = compKey&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The rest of the post is not part of the solution that I used but was part of the question so I thought I'd post it anyway.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've also found out why I couldn't use the GetSelected() function on the ListBox. The document.GetObject("ObjectId", callbackFn) uses a callback to return the object. I was calling the &lt;SPAN style="font-size: 13.3333330154419px;"&gt;GetSelected&lt;/SPAN&gt; function on the object reference before it was returned.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Within the callback the this.Data.SelectTexts() function works but it brings other problems, the GetObject() function appends another callback to your object every time a selection is made and it gets an additional one because the Extension has rerendered which also attaches yet another callback. So they stack up pretty quickly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;The only way I found to get around this is to have a variable outside the closure and then to wrap the GetObject function with an If statement to check if a handler has already been attached and then set the lb.callbackFn = null when I'm done to avoid a loop.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14383575165433294" jivemacro_uid="_14383575165433294"&gt;
&lt;P&gt;var attached = false;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // outside of the closure&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;if(!attached){&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; attached = true;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var obj = doc.GetObject("LB02");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; obj.callbackFn = function() {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var arr = ["TextValue"];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.Data.SelectTexts(arr);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.callbackFn = null;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone has a better way of doing this, please share.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps someone else at some stage.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 12:18:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Change-selection-within-Custom-Extention/m-p/920414#M1233348</guid>
      <dc:creator>organgrindingmo</dc:creator>
      <dc:date>2015-07-31T12:18:31Z</dc:date>
    </item>
  </channel>
</rss>

