aboutsummaryrefslogtreecommitdiffstats
path: root/documentation/gwt/gwt-server-side.asciidoc
blob: 1139b78a39fa2a74fe7c542d99e558dd7926128c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
---
title: Creating a Server-Side Component
order: 3
layout: page
---

[[gwt.server-side]]
= Creating a Server-Side Component

Typical server-side Vaadin applications use server-side components that are
rendered on the client-side using their counterpart widgets. A server-side
component must manage state synchronization between the widget on the
client-side, in addition to any server-side logic.

[[gwt.server-side.basic]]
== Basic Server-Side Component

The component state is usually managed by a __shared state__, described later in
<<dummy/../../../framework/gwt/gwt-shared-state#gwt.shared-state,"Shared
State">>.


----
public class MyComponent extends AbstractComponent {
    public MyComponent() {
        getState().setText("This is MyComponent");
    }

    @Override
    protected MyComponentState getState() {
        return (MyComponentState) super.getState();
    }
}
----