Common Attributes

allowedCharPattern

Sets a regular expression for the user input to check to the client-side. The allowed char pattern must be a valid JavaScript Regular Expression that matches a single character, not the sequence of characters.

For example, to allow entering only numbers and slash character, use "[0-9/]" pattern.

ariaLabel

MDN

Sets a separate, visually hidden label for accessibility technologies, such as screen readers.

autocapitalize

MDN

Sets the autocapitalize HTML attribute. It is used to define whether the text entered by the user should be automatically capitalized or not.

autocomplete

MDN

Sets the autocomplete HTML attribute for indicating whether the value of this component can be automatically completed by the browser.

autocorrect

MDN

Sets the autocorrect HTML attribute for the field.

It is supported only in Safari.

autofocus

Specifies that the component should have input focus when the page loads.

Possible values are true, false. By default, all components are not focused.

classNames

Adds CSS class names to the component.

clearButtonVisible

Sets the visibility of the button which clears the field.

colspan

Sets the number of columns that the component should occupy if it is placed in a formLayout.

Default is 1.

dataContainer

Sets a data container defined in the data section of the view XML descriptor.

If you set an InstanceContainer in the dataContainer attribute, you should also set the property attribute.

datatype

Sets a data type of the component’s content. Possible values:

  • boolean

  • byteArray

  • char

  • date

  • dateTime

  • decimal

  • double

  • fileRef

  • int

  • localDate

  • localDateTime

  • localTime

  • long

  • offsetDateTime

  • offsetTime

  • string

  • time

  • uri

  • uuid

Set this attribute if the component is not linked to an entity attribute. Otherwise, the data type is defined by the entity attribute type.

dateFormat

Sets a preferred format for date values in the component. By default, the current locale date format is used.

enabled

Sets the component explicitly disabled or enabled.

errorMessage

Sets an error message to the component.

height

Sets the height of the component.

The height should be in a format understood by the browser, for example, "100px" or "2.5em".

helperText

Defines a text adjacent to the component. It can be used, for example, to inform users which values the component expects.

id

An identifier of the component.

It is recommended to create identifiers according to the rules for Java identifiers and use camelŠ”ase, for example: userGrid, filterPanel. The id attribute can be specified for any component and should be unique within a view.

invalid

Sets an invalid state to the field considering the result of the field validation.

  • If invalid=false, the field is valid regardless of the validation result.

  • If invalid=true, the field is valid only if the validation is passed successfully.

label

Specifies the label of the component.

The attribute value can either be the text itself or a key in the message bundle. In case of a key, the value should begin with the msg:// prefix.

maxHeight

MDN

Sets the max-height CSS property of the component. The height should be in a format understood by the browser, for example, "100px" or "2.5em".

maxLength

MDN

Sets the maximum number of characters a field accepts.

maxWidth

MDN

Sets the max-width CSS property of the component. The width should be in a format understood by the browser, for example, "100px" or "2.5em".

metaClass

Defines an entity class for components displaying entities, like dataGrid or entityComboBox.

Set this attribute if the component is not linked to a data container. Otherwise, the entity type is defined by the data container.

minHeight

MDN

Sets the min-height CSS property of the component. The height should be in a format understood by the browser, for example, "100px" or "2.5em".

minLength

MDN

Sets the minimum number of characters a field accepts.

minWidth

MDN

Sets the min-width CSS property of the component. The width should be in a format understood by the browser, for example, "100px" or "2.5em".

pattern

MDN

Sets a regular expression for the value to check to the client-side. The pattern must be a valid JavaScript Regular Expression that matches the entire value, not just some subset.

placeholder

Defines a hint to the user of what can be entered in the component.

property

Sets the name of an entity attribute, which value will be displayed and edited by this visual component.

property is always used together with the dataContainer attribute.

readOnly

Specifies whether the component is in read-only mode.

required

Indicates that this field requires a value.

requiredIndicatorVisible

Sets the required indicator visibility.

requiredMessage

Used together with the required attribute. Sets a message that will be displayed to a user when the component has no value.

The attribute can contain a message or a key from message bundle, for example: requiredMessage="msg://infoTextField.requiredMessage"

step

Sets a custom time interval, in minutes, between values available for selection in the timePicker and dateTimePicker components. The default value is 60.

tabIndex

MDN

Sets the tabindex HTML attribute in the component. The attribute indicates if its element can be focused, and if/where it participates in sequential keyboard navigation:

  • A negative value (usually tabindex = -1 means that the component should be focusable, but should not be reachable via sequential keyboard navigation.

  • tabindex = 0 means that the component should be focusable in sequential keyboard navigation, but its order is defined by the document’s source order.

  • A positive value means the component should be focusable in sequential keyboard navigation, with its order defined by the value of the number. That is, tabindex = 4 would be focused before tabindex = 5, but after tabindex = 3. If multiple components share the same positive tabindex value, their order relative to each other follows their position in the document source.

text

Sets a text content of the component.

The attribute value can either be the text itself or a key in the message bundle. In case of a key, the value should begin with the msg:// prefix.

There are two ways of setting a key:

  • A short key - in this case the message will be searched in the message group of the current view. For example: msg://infoField.caption

  • Full key including message group, for example: msg://com.company.sample.view.user/infoField.caption

themeNames

Adds a theme to the component.

title

The value of the attribute is set to the title and aria-label HTML attributes. Most components interpret it as a tooltip.

value

Sets the value of the component. If the new value is not equal to getValue(), fires a value change event. May throw IllegalArgumentException if the value is not acceptable.

valueChangeMode

Sets a new value change mode for the component.

valueChangeTimeout

Applies the value change timeout of the given valueChangeMode.

visible

Sets visibility of the component.

weekNumbersVisible

Specifies whether week numbers are visible in the calendar overlay. This works only when the first day of week is set to Monday.

whiteSpace

MDN

Sets the white-space CSS property.

Default value is NORMAL.

width

Sets the width of the component. The width should be in a format understood by the browser, for example, "100px" or "2.5em".