Class FormGroup

java.lang.Object
org.patternfly.component.SubComponent<elemental2.dom.HTMLElement, FormGroup>
org.patternfly.component.form.FormGroup
All Implemented Interfaces:
ElementAttributeMethods<elemental2.dom.HTMLElement, FormGroup>, ElementClassListMethods<elemental2.dom.HTMLElement, FormGroup>, ElementConsumerMethods<elemental2.dom.HTMLElement, FormGroup>, ElementContainerMethods<elemental2.dom.HTMLElement, FormGroup>, ElementEventMethods<elemental2.dom.HTMLElement, FormGroup>, ElementIdMethods<elemental2.dom.HTMLElement, FormGroup>, ElementQueryMethods<elemental2.dom.HTMLElement>, HTMLElementAttributeMethods<elemental2.dom.HTMLElement, FormGroup>, HTMLElementDataMethods<elemental2.dom.HTMLElement, FormGroup>, HTMLElementStyleMethods<elemental2.dom.HTMLElement, FormGroup>, HTMLElementVisibilityMethods<elemental2.dom.HTMLElement, FormGroup>, IsElement<elemental2.dom.HTMLElement>, TypedBuilder<elemental2.dom.HTMLElement, FormGroup>, ComponentContext<elemental2.dom.HTMLElement, FormGroup>, HasIdentifier<elemental2.dom.HTMLElement, FormGroup>, OuiaSupport<elemental2.dom.HTMLElement, FormGroup>

public class FormGroup extends SubComponent<elemental2.dom.HTMLElement, FormGroup> implements HasIdentifier<elemental2.dom.HTMLElement, FormGroup>, ComponentContext<elemental2.dom.HTMLElement, FormGroup>
A container that groups a label, control, and helper text within a Form.
  • Field Details

  • Method Details

    • formGroup

      public static FormGroup formGroup()
    • formGroup

      public static FormGroup formGroup(String identifier)
    • addLabel

      public FormGroup addLabel(FormGroupLabel label)
    • addControl

      public FormGroup addControl(FormGroupControl control)
    • required

      public FormGroup required()
    • required

      public FormGroup required(boolean required)
    • role

      public FormGroup role(FormGroupRole role)
      Sets the role of the form group. Pass in FormGroupRole.radiogroup when the form group contains multiple radio inputs, or pass in FormGroupRole.group when the form group contains multiple of any other input type (e.g. checkboxes).

      Please note that if you set a role, the internal structure of the FormGroupLabel changes. Without a role the label contains a <label> element. With a role the <label> element is replaced by a <span> element. In this case it is expected that the FormGroupControl contains label elements.

    • store

      public <T> FormGroup store(String key, T value)
      Description copied from interface: ComponentContext
      Stores a value associated with a key.
      Specified by:
      store in interface ComponentContext<elemental2.dom.HTMLElement, FormGroup>
      Type Parameters:
      T - the type of the value being stored
      Parameters:
      key - the key associated with the value
      value - the value to be stored
    • that

      public FormGroup that()
      Specified by:
      that in interface TypedBuilder<elemental2.dom.HTMLElement, FormGroup>
    • identifier

      public String identifier()
      Description copied from interface: HasIdentifier
      Retrieves the identifier associated with this component.
      Specified by:
      identifier in interface HasIdentifier<elemental2.dom.HTMLElement, FormGroup>
      Returns:
      the identifier of the component
    • has

      public boolean has(String key)
      Description copied from interface: ComponentContext
      Determines whether a value is stored with the specified key.
      Specified by:
      has in interface ComponentContext<elemental2.dom.HTMLElement, FormGroup>
      Parameters:
      key - the key to check
      Returns:
      true if a value is stored with the specified key, false otherwise
    • get

      public <T> T get(String key)
      Description copied from interface: ComponentContext
      Retrieves the value associated with the given key from the ComponentContext.
      Specified by:
      get in interface ComponentContext<elemental2.dom.HTMLElement, FormGroup>
      Type Parameters:
      T - the type of the value being retrieved
      Parameters:
      key - the key associated with the value
      Returns:
      the value associated with the key, or null if no value is found