(Quick Reference)

timeZoneSelect

Purpose

Adds a TimeZone-populated Select field to the parent container.

Examples

// Within a form
<v:form bean="${accountInstance}">
  <v:timeZoneSelect name="timeZone">TimeZone</v:timeZoneSelect>
</v:form>

// Standalone <v:timeZoneSelect>My Time Zone Field</v:timeZoneSelect>

Description

The timeZoneSelect 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 available TimeZone instances.

This mimics Grails's timeZoneSelect 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.