Package com.vaadin.flow.component.html
Class FieldSet
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.HtmlComponent
com.vaadin.flow.component.HtmlContainer
com.vaadin.flow.component.html.FieldSet
- All Implemented Interfaces:
AttachNotifier
,DetachNotifier
,HasAriaLabel
,HasComponents
,HasElement
,HasEnabled
,HasSize
,HasStyle
,HasText
,Serializable
Represents an HTML
<fieldset>
element. This component is
used to group several UI components within a form, enhancing form
accessibility and organization.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Represents an HTML<legend>
element.Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasText
HasText.WhiteSpace
-
Constructor Summary
ConstructorsConstructorDescriptionFieldSet()
Creates a new fieldset with an empty legend.Creates a new fieldset with the given content.Creates a new fieldset with the given legend text.Creates a new fieldset using the provided legend text and content. -
Method Summary
Modifier and TypeMethodDescriptionReturns the content of the fieldset.Returns the legend component associated with this fieldset.Gets the text of the legend.void
setContent
(Component... content) Sets the content of the fieldset and removes previously set content.void
setLegendText
(String text) Sets the text of the legend.Methods inherited from class com.vaadin.flow.component.HtmlComponent
getTitle, setTitle
Methods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisible
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListener
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
Methods inherited from interface com.vaadin.flow.component.HasAriaLabel
getAriaLabel, getAriaLabelledBy, setAriaLabel, setAriaLabelledBy
Methods inherited from interface com.vaadin.flow.component.HasComponents
add, add, add, addComponentAsFirst, addComponentAtIndex, remove, remove, removeAll
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
Methods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabled
Methods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull
Methods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
Methods inherited from interface com.vaadin.flow.component.HasText
getText, getWhiteSpace, setText, setWhiteSpace
-
Constructor Details
-
FieldSet
public FieldSet()Creates a new fieldset with an empty legend. -
FieldSet
Creates a new fieldset with the given legend text.- Parameters:
legendText
- the legend text to set.
-
FieldSet
Creates a new fieldset with the given content.- Parameters:
content
- the content component to set.
-
FieldSet
Creates a new fieldset using the provided legend text and content.- Parameters:
legendText
- the legend text to set.content
- the content component to set.
-
-
Method Details
-
getLegend
Returns the legend component associated with this fieldset.- Returns:
- the legend component.
-
setLegendText
Sets the text of the legend.- Parameters:
text
- the text to set.
-
getLegendText
Gets the text of the legend.- Returns:
- the text of the legend, or null if no legend is present.
-
getContent
Returns the content of the fieldset.- Returns:
- Stream of content components
-
setContent
Sets the content of the fieldset and removes previously set content. Note: Do not include Legend in the content components. Use other FieldSet methods for setting Legend instead.- Parameters:
content
- the content components of the fieldset to set.
-