passwordField

passwordField is a masked input field for entering passwords.

XML Element

passwordField

Java Class

JmixPasswordField

Basics

The following example demonstrates basic passwordField functionality:

<passwordField id="passwordField" label="PasswordField"/>

The set of attributes for the passwordField component is similar to the attributes available for the textField component. However, there is no datatype attribute – the input for a passwordField can only be of type String.

Data-aware passwordField

Use the dataContainer and property attributes to bind passwordField to an entity attribute. The data container provides the entity instance, and property identifies the attribute to edit.

<data>
    <instance id="productTagDc"
              class="io.jmix.uisamples.entity.ProductTag"
              fetchPlan="_local"/>
</data>
    <passwordField id="passwordField" label="Field connected to a container" width="15em"
                     dataContainer="productTagDc" property="name"/>

Theme Variants

Use the themeNames attribute to apply one or more theme variants.

Variant Description Supported By

small

Makes the component smaller.

Aura, Lumo

align-left

Aligns the field value to the left side.

Aura, Lumo

align-center

Centers the field value.

Aura, Lumo

align-right

Aligns the field value to the right side.

Aura, Lumo

helper-above-field

Renders the helper text above the field, below the label.

Aura, Lumo

Attributes

The following attributes are specific to passwordField:

Name Description Default

autoselect

Controls whether text is selected automatically when the field receives focus.

clearButtonVisible

Controls whether the field displays a clear button.

false

value

Sets the component value.

The following shared attributes are supported by passwordField:

Handlers

The following handlers are specific to passwordField:

Name Description

validator

Validates the component value.

The following shared handlers are supported by passwordField:

Elements

A passwordField can include tooltip, validator, prefix, and suffix as its nested elements.