Directory

← Back

Restrain

Set minimum and maximum width and height for any component.

Author

Rating

Popularity

<100

The standard Vaadin component API only let's you specify the width and height of them, but not minimum or maximum width and height.

The Restrain extension fixes that, and allows you to easily specify all of those with a server API.

Notice: the min/max sizes don’t always work together with the Vertical and Horizontal layout expand rations. This is a known limitation set by the implementation details in the core layouts.

Sample code

new Restrain(component)
    .setMinWidth("200px")
    .setMaxWidth("800px")
    .setMinHeight("40px")
    .setMaxHeight("150px");

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

First version. Feedback welcome.

Released
2013-12-13
Maturity
EXPERIMENTAL
License
Apache License 2.0

Compatibility

Framework
Vaadin 7.1+
Browser
Internet Explorer
Internet Explorer
Internet Explorer
Firefox
Opera
Safari
Google Chrome
Internet Explorer
iOS Browser
Android Browser
Internet Explorer
Internet Explorer
Windows Phone

Restrain - Vaadin Add-on Directory

Set minimum and maximum width and height for any component. Restrain - Vaadin Add-on Directory
The standard Vaadin component API only let's you specify the width and height of them, but not minimum or maximum width and height. The Restrain extension fixes that, and allows you to easily specify all of those with a server API. Notice: the min/max sizes don’t always work together with the Vertical and Horizontal layout expand rations. This is a known limitation set by the implementation details in the core layouts.
Author Homepage
Issue Tracker
Source Code

Restrain version 0.1
First version. Feedback welcome.

Online