(Quick Reference)
localeSelect
Purpose
Adds a Locale-populated
Select field to the parent container.
Examples
// Within a form
<v:form bean="${accountInstance}">
<v:localeSelect name="locale">Locale</v:localeSelect>
</v:form>// Standalone
<v:localeSelect>My Locale Select</v:localeSelect>
Description
The localeSelect tag is a special type of
field tag, where the field component
is a Vaadin
Select.
The select is auto-populated with the list of default
Locale instances.
This mimics Grails's
localeSelect tag.
Body
- Contains the caption for the field
Attributes
Specific
name
(optional) The property name of the field
caption
(optional) The caption of the field. Overrides the body content.
type
(optional) The class (or its fully-qualified name) of the Vaadin Component to use for the field, or a recognised short type-name: comboBox
, listSelect
, optionGroup
, select
from
(optional) The data to use as containerDataSource. Either a comma-separated String, a collection of objects or a Vaadin Container.
itemIds
(optional) Override the default itemIds. Either a comma-separated String or a collection of objects.
itemId
(optional) Override the default itemId for each item. Either a closure that takes an Item parameter and returns an id, or the name of a property of the underlying bean.
itemCaption
(optional) Override the default itemCaption for each item. Either a closure that takes an Item parameter and returns a caption, or the name of a property of the underlying bean.
itemCaptionMessagePrefix
(optional) Obtain the itemCaption using i18n. Mimics Grails's valueMessagePrefix attribute. The specified value will be prepended (plus a dot '.'
) to the itemCaption, and the resulting string will be used for an i18n lookup. If this fails, the itemCaption is left unchanged.
itemIcon
(optional) Display an icon for each item. Either a closure that takes an Item parameter and returns an icon, or the name of a property of the underlying bean.
The resulting value should be a Vaadin Resource, or a String path to the resource. If the path starts with /
or contains ://
, it is treated as a URL; otherwise, it is treated as a path relative to the directory of the Vaadin application's active theme.
onValueChange
(optional) Either a ValueChangeListener or a Closure that takes a ValueChangeEvent parameter.
Remember to set immediate="true"
if you want the ValueChangeEvent
to fire immediately when the user selects a new value.
General
var
(optional) Uses Grails's set tag to set the value of the specified variable to be this component.
class
(optional) The CSS class name to add to the component using the addStyleName() method
sizeUndefined
(optional) Calls setSizeUndefined() on the component. (Attribute value is ignored)
sizeFull
(optional) Calls setSizeFull() on the component. (Attribute value is ignored)
See Vaadin Select API docs for full list of allowed attributes.