Directory

← Back

LazyLoadWrapper

A lazy load wrapper for Vaadin GUI components

Author

Rating

Lazy Load Wrapper is a wrapper component for Vaadin GUI components that can reduce the time that it takes for a web application to load. The wrapper creates a lightweight placeholder on the client side that is replaced with the actual component when it becomes visible on the client side.

The API of the wrapper is designed so that it will require minimalistic extra coding when used. This is why almost all features of the wrapper can be accessed through the constructors. The default settings and automatic sizing feature of the placeholder will also cut down on the number of parameters that are required to set.

Vaadin 6 Version:

  • server-side lazy load
  • server-side lazy component provider
  • client-side lazy load (lazy draw)

Vaadin 7 alpha:

  • server-side lazy load
  • server-side lazy component provider
  • server-side reinit of LLW

Sample code

private void wrapperExample() {

        /*
         * Example of how to wrap a Panel inside a lazy load wrapper
         */
        Panel examplepanel = new Panel("This is your panel");
        examplepanel.addComponent(new Label("This is your content"));
        examplepanel.addComponent(new Button("A button"));

        /*
         * Set a size for the panel (the wrapper will automatically size the
         * placeholder if child has absolute sizes)
         */
        examplepanel.setWidth("300px");
        examplepanel.setHeight("200px");

        /* This is how you would normally add your panel to your application. */
        // mainWindow.addComponent(examplepanel);

        /* This is how you can easily wrap the component inside the wrapper; */
        mainWindow.addComponent(new LazyLoadWrapper(examplepanel));



         /*
         * If we want to, we can size the placeholder size manually.
         */
        Button aButton = new Button("Wrapped button");
        mainWindow.addComponent(new LazyLoadWrapper(aButton, "120px", "30px"));

}

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

Released
2010-04-12
Maturity
STABLE
License
Apache License 2.0

Compatibility

Framework
Vaadin 6.3+
Vaadin 6.4+ in 1.0.1
Vaadin 7.0+ in 0.1 alpha
Browser
Firefox
Safari

Vaadin Add-on Directory

Find open-source widgets, add-ons, themes, and integrations for your Vaadin application. Vaadin Add-on Directory
The channel for finding, promoting, and distributing Vaadin add-ons.
Online