|
Vaadin user interface components are built on a skeleton of interfaces and abstract classes that define and implement the features common to all components and the basic logic how the component states are serialized between the server and the client. This section gives details on the basic component interfaces and abstractions. The layout and other component container abstractions are described in Chapter 6, Managing Layout. The interfaces that define the Vaadin data model are described in Chapter 9, Binding Components to Data.
All components also implement the
In addition to the interfaces defined within the Vaadin framework, all components implement the
The Components are laid out in the user interface hierarchically. The layout is managed by layout components, or more generally components that implement the The A component does not know its parent when the component is created, so you can not refer to the parent in the constructor with public class AttachExample extends CustomComponent {
public AttachExample() {
// ERROR: We can't access the application object yet.
ClassResource r = new ClassResource("smiley.jpg",
getApplication());
Embedded image = new Embedded("Image:", r);
setCompositionRoot(image);
}
} Adding a component to an application triggers calling the public class AttachExample extends CustomComponent {
public AttachExample() {
}
@Override
public void attach() {
super.attach(); // Must call.
// Now we know who ultimately owns us.
ClassResource r = new ClassResource("smiley.jpg",
getApplication());
Embedded image = new Embedded("Image:", r);
setCompositionRoot(image);
}
} The attachment logic is implemented in
Fields are components that have a value that the user can change through the user interface. Figure 5.3, “Field Components” illustrates the inheritance relationships and the important interfaces and base classes. Field components are built upon the framework defined in the Fields are strongly coupled with the Vaadin data model. The field value is handled as a The description of the field interfaces and base classes is broken down in the following sections. The You can set the field value with the The
When the value of a field changes, a |
Table of Contents
|