title: Bookmarks drop user off at wrong page
body: <p>When clicking on a public or private bookmark, Spotfire takes the user to the page that the user was on DIRECTLY BEFORE he or she created the bookmark. If the user were to select the bookmark again, it would then take them to the correct page, with the correct measures loaded.</p>
  
  <p>This happens whether the GUI bookmark is clicked, or a bookmark link is clicked. In fact, if a link is clicked, it is almost impossible to get to the correct bookmark page (the user has to click <em>very</em> fast). </p>
  
  <p>After a ton of trial and error, I limited it down to some HTML/Javascript functionality. In this dashboard, users navigate by using a custom navigation bar. If a user creates a bookmark, changes pages using the custom navigation bar, then clicks on the bookmark, it will not work correctly. If a user creates the bookmark, clicks the page tab then clicks on the bookmark, it will work correctly. I used the <a href="https://community.tibco.com/wiki/spotfire-navigation-script-leveraging-python" rel="nofollow noreferrer">code here</a> to build the python script that changes pages (kicked off by a changing Document Property). I was able to reproduce this bug in the sample spotfire reports. The below HTML code is for the Nav bar:</p>
  
  <pre><code>&lt;style&gt;
  .topnav {
    overflow: hidden;
    background-color: #313814A;
  }
  
  .topnav a {
    float: left;
    color: #f2f2f2;
    text-align: center;
    padding: 5px 16px;
    text-decoration: none;
    font-size: 16px;
    font-family:Calibri;
  }
  
  .topnav a:hover {
    background-color: #ddd;
    color: black;
    cursor: pointer;
  }
  
  .topnav a.active {
    background-color: #ddd;
    color: black;
  }
  &lt;/style&gt;
  
  &lt;div class="topnav"&gt;
    &lt;a onclick="SBAReporting()"&gt;Reports&lt;/a&gt;
  &lt;/div&gt;
  
  &lt;!-- input field that changes the Doc Prop that fires off the python script--&gt;
  &lt;div id="navigateToPage" style="display:none"&gt;&lt;SpotfireControl id="f9cc2258568d415383d842064287993a" /&gt;&lt;/div&gt; 
  
  &lt;script&gt;
  
  function SBAReporting() {
  randInt = Math.floor(Math.random() * (100+1))
  myJSObject = "Reporting";
  document.getElementById('navigateToPage').firstChild.value = myJSObject + randInt;
  
  $("#navigateToPage input").focus();
  $("#navigateToPage input").blur();
  }
  
  &lt;/script&gt;
  </code></pre>
  
  <p>My theory on what is happening is the following: </p>
  
  <ol>
  <li>User clicks on the custom HTML/Python navigation to get back to a page. Spotfire has some internal variable that does not get set correctly.</li>
  <li>The user selects the bookmark. Spotfire thinks they are already on the correct page so it does not navigate there. Part of the bookmark process sets that mystery variable correctly.</li>
  <li>The second time clicked, that variable is set correctly, spotfire knows what page you are on, and it works correctly.</li>
  </ol>
  
  <p>I tried to refresh the entire page (and hopefully that variable) by adding <code>location.reload();</code> but that did not work. Is there a way to let Spotfire refresh the page? Any insight on what may not be updating correctly?</p>
  
  <p><strong>tl;dr</strong> It seems that the pythonic way to change pages in Spotfire does not alter some behind the scenes variable to let Spotfire know what page the user is truly on. This happens with sample Spotfire provided reports and Spotfire provided Python Scripts. I need a better way of letting Spotfire know what page a user is on.</p>
  
  <p><strong>UPDATE</strong> A defect has been logged with TIBCO. Still open to work-arounds.</p>