Skip to main content

Overview

HasInputFieldElement is a convenience mixin interface that groups common capabilities of Vaadin input field components. It combines several specialized interfaces to provide a unified set of features for components that support labels, values, helper text, and styling. This interface does not define any methods of its own but serves as a composition of other mixin interfaces, providing a convenient way to declare that an element supports all standard input field capabilities. Interface Location: org.vaadin.addons.dramafinder.element.shared.HasInputFieldElement

Composed Interfaces

HasInputFieldElement extends the following interfaces:
  • HasHelperElement - Helper text support via helper slot
  • HasValueElement - Value handling for input fields
  • HasStyleElement - CSS class styling support
  • HasLabelElement - Visible label support

Methods

Since this interface is a pure composition mixin, it inherits all methods from its parent interfaces. See the individual interface documentation for available methods:

Implementing Classes

The following element classes implement HasInputFieldElement:
  • TextFieldElement (and its subclasses: TextAreaElement, PasswordFieldElement, EmailFieldElement)
  • AbstractNumberFieldElement (and its subclasses: NumberFieldElement, IntegerFieldElement, BigDecimalFieldElement)
  • DatePickerElement
  • DateTimePickerElement
  • TimePickerElement
  • ComboBoxElement
  • MultiSelectComboBoxElement
  • SelectElement

Usage Example

import org.vaadin.addons.dramafinder.element.TextFieldElement;
import com.microsoft.playwright.Page;

public class InputFieldTest {
    void testInputField(Page page) {
        // Get a text field by its label
        TextFieldElement field = TextFieldElement.getByLabel(page, "Email");
        
        // Methods from HasLabelElement
        field.assertLabel("Email");
        
        // Methods from HasValueElement
        field.setValue("[email protected]");
        field.assertValue("[email protected]");
        
        // Methods from HasHelperElement
        field.assertHelperHasText("Enter your email address");
        
        // Methods from HasStyleElement
        field.assertCssClass("custom-field");
    }
}

Design Purpose

This mixin interface follows the Composition Pattern to avoid code duplication across input field implementations. Instead of each input field class implementing the same set of interfaces repeatedly, they can simply implement HasInputFieldElement to gain all standard input field capabilities.

Build docs developers (and LLMs) love