<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:clearspace="http://www.jivesoftware.com/xmlns/jive/rss" version="2.0">
  <channel>
    <title>Content in Tableau Community Forums</title>
    <link>/profile-content.jspa?filterID=contentstatus[published]&amp;targetUser=25740</link>
    <description>Recent content in Tableau Community Forums</description>
    <language>en</language>
    <pubDate>Fri, 08 Nov 2013 15:20:59 GMT</pubDate>
    <generator>Jive Engage 8.0.5.0  (http://jivesoftware.com/products/)</generator>
    <dc:date>2013-11-08T15:20:59Z</dc:date>
    <dc:language>en</dc:language>
    <item>
      <title>Temporarily disabling Tableau JavaScript's MARKS_SELECTION event listener</title>
      <link>https://community.tableau.com/thread/135337</link>
      <description>&lt;!-- [DocumentBodyStart:7957c733-eb3e-48d0-a97b-818b10dcb0e1] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;I'm working on a JavaScript framework that integrates Tableau worksheets using Tableau's JavaScript API such that a selection in one sheet is applied to all others.&amp;#160; The sheets are dynamic thus this is my preferred solution.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;I need to disable the marks event listener so that my marks automation doesn't cause it to infinitely trigger.&amp;#160; It appears to me this should be done in the then() promise (shown below in bold) but unfortunately, the marks event is still triggered infinitely.&amp;#160; Help! &lt;span aria-label="Happy" class="emoticon_happy emoticon-inline" style="height:16px;width:16px;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;As expected, removing addEventListener() in the then() promise stops the event from infinitely triggering -- but, of course, it only works once then.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;Here is the paired down code... it may not be perfect since I removed some extra code, but it demonstrates the pattern I'm attempting:&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt; font-family: 'courier new', courier;"&gt;Analytic.prototype.applyMarks = function (marks) {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: 'courier new', courier; font-size: 8pt; line-height: 1.5em;"&gt;&amp;#160;&amp;#160;&amp;#160; // remove marks selection listener to prevent selectMarksAsync from triggering it&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: 'courier new', courier; font-size: 8pt; line-height: 1.5em;"&gt;&amp;#160;&amp;#160;&amp;#160; this.viz.removeEventListener(tableauSoftware.TableauEventName.MARKS_SELECTION, this.marksSelectionFunc);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: 'courier new', courier; font-size: 8pt; line-height: 1.5em;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // set marks programmatically&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: 'courier new', courier; font-size: 8pt; line-height: 1.5em;"&gt;&amp;#160;&amp;#160;&amp;#160; worksheet.selectMarksAsync(marks, tableauSoftware.SelectionUpdateType.REPLACE).then(&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt; font-family: 'courier new', courier;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // re-establish marks selection listener&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;span style="font-family: 'courier new', courier;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;strong&gt;$.proxy(&lt;/strong&gt;&lt;/span&gt;&lt;span style="font-family: 'courier new', courier;"&gt;&lt;strong&gt;this.viz.addEventListener(tableauSoftware.TableauEventName.MARKS_SELECTION, this.marksSelectionFunc), this);&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; );&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt; font-family: 'courier new', courier;"&gt;};&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:7957c733-eb3e-48d0-a97b-818b10dcb0e1] --&gt;</description>
      <pubDate>Fri, 08 Nov 2013 15:20:59 GMT</pubDate>
      <author>tableaucommunity@tableau.com</author>
      <guid>https://community.tableau.com/thread/135337</guid>
      <dc:date>2013-11-08T15:20:59Z</dc:date>
      <clearspace:dateToText>5 years 8 months ago</clearspace:dateToText>
      <clearspace:replyCount>2</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
  </channel>
</rss>

