Class Form

All Implemented Interfaces:
Iterable<FormGroup>, ElementAttributeMethods<HTMLFormElement, Form>, ElementClassListMethods<HTMLFormElement, Form>, ElementConsumerMethods<HTMLFormElement, Form>, ElementContainerMethods<HTMLFormElement, Form>, ElementEventMethods<HTMLFormElement, Form>, ElementIdMethods<HTMLFormElement, Form>, ElementQueryMethods<HTMLFormElement>, HTMLElementAttributeMethods<HTMLFormElement, Form>, HTMLElementDataMethods<HTMLFormElement, Form>, HTMLElementStyleMethods<HTMLFormElement, Form>, HTMLElementVisibilityMethods<HTMLFormElement, Form>, IsElement<HTMLFormElement>, TypedBuilder<HTMLFormElement, Form>, Component, HasItems<HTMLFormElement, Form, FormGroup>, Modifiers.Horizontal<HTMLFormElement, Form>

A form is a group of elements used to collect information from a user in a variety of contexts, including in a modal, in a wizard, or on a page. Use cases for forms include tasks reliant on user-inputted information for completion like logging in, registering, configuring settings, or completing surveys.
See Also:
  • Method Details

    • form

      public static Form form()
    • addItems

      public <T> Form addItems(Iterable<T> items, Function<T, FormGroup> display)
      Description copied from interface: HasItems
      Adds a collection of items to the component. The method applies the provided function to each item in the given iterable to transform it into a subcomponent, which is then added to the component.
      Specified by:
      addItems in interface HasItems<HTMLFormElement, Form, FormGroup>
      Type Parameters:
      T - the type of the items in the iterable
      Parameters:
      items - the iterable collection of items to be added
      display - the function used to transform each item into a subcomponent
      Returns:
      the builder instance after adding the items
    • addItem

      public Form addItem(FormGroup item)
      Description copied from interface: HasItems
      Adds a single item to the component.
      Specified by:
      addItem in interface HasItems<HTMLFormElement, Form, FormGroup>
      Parameters:
      item - the item to be added
      Returns:
      the builder instance after adding the item
    • addGroup

      public Form addGroup(FormGroup group)
    • add

      public Form add(FormGroup item)
      Description copied from interface: HasItems
      Adds an item to the component.
      Specified by:
      add in interface HasItems<HTMLFormElement, Form, FormGroup>
      Parameters:
      item - the item to be added to the component
      Returns:
      the builder instance after the item has been added
    • addAlert

      public Form addAlert(FormAlert alert)
    • add

      public Form add(FormAlert alert)
    • addSection

      public Form addSection(FormSection section)
    • addFieldGroup

      public Form addFieldGroup(FormFieldGroup fieldGroup)
    • addActionGroup

      public Form addActionGroup(FormActionGroup actionGroup)
    • limitWidth

      public Form limitWidth()
    • that

      public Form that()
      Specified by:
      that in interface TypedBuilder<HTMLFormElement, Form>
    • onAdd

      public Form onAdd(AddItemHandler<Form, FormGroup> onAdd)
      Description copied from interface: HasItems
      Registers a callback to be invoked whenever a new item is added to the component.
      Specified by:
      onAdd in interface HasItems<HTMLFormElement, Form, FormGroup>
      Parameters:
      onAdd - a AddItemHandler that takes the builder instance and the item being added as arguments
      Returns:
      the builder instance after adding the callback
    • onUpdate

      public Form onUpdate(UpdateItemHandler<Form, FormGroup> onUpdate)
      Description copied from interface: HasItems
      Registers a callback to be invoked whenever an item is updated in the component.
      Specified by:
      onUpdate in interface HasItems<HTMLFormElement, Form, FormGroup>
      Parameters:
      onUpdate - a UpdateItemHandler that takes the component, the previous state of the item, and the updated state of the item as arguments
      Returns:
      the builder instance after adding the callback
    • onRemove

      public Form onRemove(RemoveItemHandler<Form, FormGroup> onRemove)
      Description copied from interface: HasItems
      Registers a callback to be invoked whenever an item is removed from the component.
      Specified by:
      onRemove in interface HasItems<HTMLFormElement, Form, FormGroup>
      Parameters:
      onRemove - a RemoveItemHandler that takes the component and the item being removed as arguments
      Returns:
      the builder instance after adding the callback
    • iterator

      public Iterator<FormGroup> iterator()
      Specified by:
      iterator in interface Iterable<FormGroup>
    • size

      public int size()
      Description copied from interface: HasItems
      Retrieves the total number of items currently contained in the component.
      Specified by:
      size in interface HasItems<HTMLFormElement, Form, FormGroup>
      Returns:
      the number of items contained in the component
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: HasItems
      Checks whether the collection of items in the component is empty.
      Specified by:
      isEmpty in interface HasItems<HTMLFormElement, Form, FormGroup>
      Returns:
      true if the component contains no items; false otherwise
    • contains

      public boolean contains(String identifier)
      Description copied from interface: HasItems
      Checks whether the component contains an item associated with the given identifier.
      Specified by:
      contains in interface HasItems<HTMLFormElement, Form, FormGroup>
      Parameters:
      identifier - the identifier of the item to be checked
      Returns:
      true if the component contains an item associated with the provided identifier, false otherwise
    • item

      public FormGroup item(String identifier)
      Description copied from interface: HasItems
      Retrieves the item associated with the specified identifier from the component.
      Specified by:
      item in interface HasItems<HTMLFormElement, Form, FormGroup>
      Parameters:
      identifier - the identifier of the item to be retrieved
      Returns:
      the item associated with the given identifier, or null if no item is found
    • updateItem

      public void updateItem(FormGroup item)
      Description copied from interface: HasItems
      Updates an existing item in the component.
      Specified by:
      updateItem in interface HasItems<HTMLFormElement, Form, FormGroup>
      Parameters:
      item - the item to be updated
    • removeItem

      public void removeItem(String identifier)
      Description copied from interface: HasItems
      Removes an item from the component based on the provided identifier.
      Specified by:
      removeItem in interface HasItems<HTMLFormElement, Form, FormGroup>
      Parameters:
      identifier - the identifier of the item to be removed
    • clear

      public void clear()
      Description copied from interface: HasItems
      Clears all items from the component. This method removes any existing items within the component, leaving it empty. Any associated or registered callbacks related to the removal of items may be invoked as part of this operation.
      Specified by:
      clear in interface HasItems<HTMLFormElement, Form, FormGroup>
    • clearAlerts

      public void clearAlerts()