1 Reply Latest reply on Aug 26, 2013 4:20 AM by Russell Christopher

    Using Java to Refresh Dashboards

    Catherine Denmeade

      We have a series of 'live' dashboards which are refreshed via HTML scripts every two minutes - this works, but the time it takes to refresh is too long.


      I hear through the grapevine that doing this via Java gets better results... but I've read all the documentation and I'm lost.

      I'm hoping someone can help me to translate my HTML script into a Java function or point me to an example that does this (I couldn't find any 'refresh' examples in the documentation)...


      Huge thanks in advance!!


       

      <html>
      <head>
        <meta http-equiv="refresh" content="35; url=2.html" />
      <title>HTML iFrame tag with auto refresh</title>
      </head>
      <body>
      <script type="text/javascript" src="http://tabprod.xxxx.xxxxx.ad/javascripts/api/viz_v1.js"></script>
      <div class="tableauPlaceholder" style="width:1415px; height:587px;">
      <object class="tableauViz" width="1890" height="1020" style="display:none;">
        <param name="host_url" value="http%3A%2F%2Ftabprod.xxxx.xxxxx.ad%2F" />
        <param name="site_root" value="&#47;t&#47;xxxxx" />
        <param name="name" value="Combined_KPIs_From6am_v1&#47;Dashboard_Wall" />
        <param name="tabs" value="no" />
        <param name="toolbar" value="no" />
        <param name="comments" value="no" />
        <param name="refresh" value="yes" />
      </object>
      </div>
      </body>
      </html>
        • 1. Re: Using Java to Refresh Dashboards
          Russell Christopher

          Hey Catherine!

           

          You heard right! You have a choice to make, though. The way in which you're embedding your viz (above) will only allow you to use our older JavaScript API...It's quite basic.

           

          If you don't care, all you need is a little bit more code, like this:

           

          <script>

              functionThatIsCalled(){    

                   var viz = window.tableau.vizs[0];

                   viz.refresh();

               }

          </script>

           

          You'd call the function above from the onClick of a button, the onChange of a combo-box, etc.

           

          If you want to use the latest / greatest API , you can find it here:

           

          JavaScript API Tutorial

           

          Hope this helps.