|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Retention(value=RUNTIME) @Target(value=TYPE) public @interface ClientWidget
Annotation defining the default client side counterpart in GWT terminal for
Component
.
With this annotation server side Vaadin component is marked to have a client side counterpart. The value of the annotation is the class of client side implementation.
Note, even though client side implementation is needed during development, one may safely remove them from the classpath of the production server.
Required Element Summary | |
---|---|
Class<? extends Paintable> |
value
|
Optional Element Summary | |
---|---|
ClientWidget.LoadStyle |
loadStyle
Depending on the used WidgetMap generator, these optional hints may be used to define how the client side components are loaded by the browser. |
Element Detail |
---|
public abstract Class<? extends Paintable> value
public abstract ClientWidget.LoadStyle loadStyle
EagerWidgetMapGenerator
, but if the WidgetMapGenerator
is
used by the widgetset, these load style hints are respected.
Lazy loading of a widget implementation means the client side component
is not included in the initial JavaScript application loaded when the
application starts. Instead the implementation is loaded to the client
when it is first needed. Lazy loaded widget can be achieved by giving
ClientWidget.LoadStyle.LAZY
value in ClientWidget annotation.
Lazy loaded widgets don't stress the size and startup time of the client side as much as eagerly loaded widgets. On the other hand there is a slight latency when lazy loaded widgets are first used as the client side needs to visit the server to fetch the client side implementation.
The ClientWidget.LoadStyle.DEFERRED
will also not stress the initially loaded
JavaScript file. If this load style is defined, the widget implementation
is preemptively loaded to the browser after the application is started
and the communication to server idles. This load style kind of combines
the best of both worlds.
Fine tunings to widget loading can also be made by overriding
WidgetMapGenerator
in the GWT module. Tunings might be helpful if
the end users have slow connections and especially if they have high
latency in their network. The CustomWidgetMapGenerator
is an
abstract generator implementation for easy customization. Vaadin package
also includes LazyWidgetMapGenerator
that makes as many widgets
lazily loaded as possible.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |