Directory

← Back

FlexibleOptionGroup

A flexible way to layout OptionGroup radio buttons or check boxes.

Author

Contributors

Rating

The goal of FlexibleOptionGroup is to provide a very flexible way to layout OptionGroup radio buttons or check boxes.

The FlexibleOptionGroup component itself cannot be added to to any layout Instead, add FlexibleOptionGroupItemComponents to your layout. Each FlexibleOptionGroupItemComponent represents a radio button or a check box of an item.

Sample code

// Don't add FlexibleOptionGroup to application
FlexibleOptionGroup fop = new FlexibleOptionGroup();
fop.setContainerDataSource(createTestContainer());
fop.setItemCaptionPropertyId(CAPTION_PROPERTY);
fop.setItemIconPropertyId(ICON_PROPERTY);

HorizontalLayout optionGroupLayout = new HorizontalLayout();
for (Iterator<FlexibleOptionGroupItemComponent> iter = fop
		.getItemComponentIterator(); iter.hasNext();) {
	FlexibleOptionGroupItemComponent comp = iter.next();

	// Add FlexibleOptionGroupItemComponents instead
	optionGroupLayout.addComponent(comp);

	Label captionLabel = new Label();
	captionLabel.setIcon(comp.getIcon());
	captionLabel.setCaption(comp.getCaption());
	optionGroupLayout.addComponent(captionLabel);
}
mainWindow.addComponent(optionGroupLayout);

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

Fixed issue #8.

Released
2015-04-04
Maturity
STABLE
License
Apache License 2.0

Compatibility

Framework
Vaadin 7.1+
Vaadin 6.5+ in 1.0.0
Vaadin 7.0+ in 2.0.0
Browser
Internet Explorer
Internet Explorer
Internet Explorer
Firefox
Opera
Safari
Google Chrome
Internet Explorer
iOS Browser
Android Browser
Internet Explorer
Internet Explorer
Windows Phone

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