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 – binding data to properties

There's no better way to learn than practice. Follow these steps to see how binding works in real life:

  1. Create a new project named binding using your IDE. A Vaadin one, of course.
  2. Don't hesitate and delete all the content in the generated BindingUI class.
  3. Create a new local instance of TextField and turn immediate mode on:
      @Override
      protected void init(VaadinRequest request) {
        TextField textField = new TextField("Data");
        textField.setImmediate(true);
      }
  4. Create a new local instance of Label:
        Label label = new Label();
  5. Add the TextField and Label components to a new VerticalLayout and set it to be the content of the UI:
    VerticalLayout layout = new VerticalLayout(); layout.addComponent(textField); layout.addComponent(label); ...

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