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 – using navigators

Let's pour some architectural sugar:

  1. Create a new Vaadin project. We are using navigator as project name.
  2. Implement a view for the Welcome page:
    public class Welcome extends VerticalLayout implements View {
      public Welcome() {
        addComponent(new Label("Welcome"));
      }
    
      @Override
      public void enter(ViewChangeEvent event) {
        Notification.show("Showing Welcome page");
      }
    
    }
  3. Implement a view for the Page1 class:
    public class Page1 extends VerticalLayout implements View {
    
      public Page1() {
        addComponent(new Label("Page 1"));
      }
    
      @Override
      public void enter(ViewChangeEvent event) {
        Notification.show("Showing page 1");
      }
    
    }
  4. Use the previous Page1 class to implement a Page2 class. Don't forget to change the label content and the notification ...

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