title: Vaadin: how do I use Navigator from a View?
body: <p>I'm looking at Vaadin plugin in Grails at the moment and this is what I'm trying to implement:</p>
  
  <p>I have an <code>UI</code> class and two <code>View</code> classes</p>
  
  <p>The UI code has a navigator in it:</p>
  
  <pre><code>class MyUI extends UI {
  
      @Override
      protected void init(VaadinRequest vaadinRequest) {
          Navigator navigator = new Navigator(this, this)
  
          navigator.addView(MainView.NAME, new MainView())
  
          navigator.addView(CountView.NAME, CountView.class)
  
      }
  }
  </code></pre>
  
  <p>In the MainView there is a <code>Button</code> and I want the user to be redirected to <code>CountView</code> after the button is clicked. I added the <code>Button.ClickListener()</code>, but I can't get hold of the <code>Navigator</code> instance in the <code>View</code> to navigate to the desired page.</p>
  
  <p>I'd be grateful if you could provide me an example of this.</p>