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:
- Create a new project named binding using your IDE. A Vaadin one, of course.
- Don't hesitate and delete all the content in the generated
BindingUI
class. - 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); }
- Create a new local instance of
Label
:Label label = new Label();
- Add the
TextField
andLabel
components to a newVerticalLayout
and set it to be the content of the UI:VerticalLayout layout = new VerticalLayout(); layout.addComponent(textField); layout.addComponent(label); ...
Get Vaadin 7 UI Design By Example Beginner's Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.