(Quick Reference)

label

Purpose

Adds a Vaadin Label component to the parent container.

Examples

<v:label>Hello world!</v:label>

<v:label contentMode="preformatted">Hello World!</v:label>

<v:label contentMode="raw"><span><b>Hello World!</b></span></v:label>

<v:label contentMode="text">Hello World!</v:label>

<v:label contentMode="xhtml"><some><xhtml></xhtml></some></v:label>

<v:label contentMode="xml"><some><xml/></some></v:label>

When calling this tag as a GSP method, use the createLabel method as follows:

${v.createLabel(value:'Hello World!')}

Description

Body

  • Used as the value of the label, unless overriden by the value attribute.

Attributes

Specific
  • value (optional) The value of the label (i.e. the displayed caption). Overrides the value in the body.
  • contentMode (optional) The content mode for the label. The label component expects an integer for this property. If a String is passed through, it is automatically parsed and converted to the Vaadin Label.CONTENT_* type. Allowed String values: 'preformatted', 'raw', 'text', 'xhtml', 'xml', 'default'

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)
  • location (optional) The location slot in the parent container to which this component should be added.
  • wrapperClass, wrapperStyle (optional) Special styling for wrapper <div>.

See Vaadin Label API docs for full list of allowed attributes