O'Reilly logo

Vaadin 7 UI Design By Example Beginner's Guide by Alejandro Duarte

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – navigating programmatically

  1. Our website is ready to include some links on it. We will add links to Page 1 and Page 2 inside the Welcome page.
  2. We want to add links to the Welcome page, so we need to edit Welcome.java. First we need a navigator to navigate to the other pages (we will initialize this navigator instance later):
    public class Welcome extends VerticalLayout implements View {
    
      private Navigator navigator;
    
      // ...
    
    }
  3. We are adding buttons and a button without a click listener is like a heart without a beat (seems to be that writer is getting crazy again). So let's code a listener that calls our navigator:
    public class Welcome extends VerticalLayout implements View {
    
      // ...
    
      public Welcome() {
     ClickListener listener = new ClickListener() ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required