title: VAADIN 7: What is the simplest way to refresh a Vaadin View in 5 minute intervals?
body: <p>I'm trying to implement an automatic refresh on a List of components in a Vaadin view. The list gets its contents from a database. I can refresh the list with a button, that is already implemented.</p>
  
  <p>However, I would like to know what is the simplest way to make it so, that this refresh event, that I already have, would automatically refresh in 5 minute (300 000 milliseconds) intervals?</p>
  
  <p>Here's what I tried and it keeps refreshing even after I exit the view so it doesn't really work. <strong>I'd like the refresh to happen in 5 minute intervals only while that certain view is being shown.</strong></p>
  
  <pre><code>UI myUI = UI.getCurrent();  
  
              myUI.setPollInterval(300000);
              myUI.addPollListener(event -&gt; {
                  refreshList();
              });
  </code></pre>
  
  <p>How would I make it so that the refresh doesn't happen after navigating to other views? And is there some simpler way to do this in Vaadin? Thank you</p>