@NpmPackage(value="@vaadin/vaadin-radio-button",
version="1.6.3")
public class RadioButtonGroup<T>
extends GeneratedVaadinRadioGroup<RadioButtonGroup<T>,T>
implements com.vaadin.flow.data.binder.HasItemsAndComponents<T>, com.vaadin.flow.data.selection.SingleSelect<RadioButtonGroup<T>,T>, com.vaadin.flow.data.binder.HasDataProvider<T>, com.vaadin.flow.component.HasValidation, com.vaadin.flow.component.HasHelper, com.vaadin.flow.component.HasLabel, com.vaadin.flow.data.binder.HasValidator<T>, HasClientValidation
This is a server side Java integration for the vaadin-radio-group
element.
Usage examples, see the demo in vaadin.com.
GeneratedVaadinRadioGroup.InvalidChangeEvent<R extends GeneratedVaadinRadioGroup<R,?>>com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C extends com.vaadin.flow.component.Component,V>com.vaadin.flow.data.binder.HasItemsAndComponents.ItemComponent<T>com.vaadin.flow.component.HasValue.ValueChangeEvent<V>, com.vaadin.flow.component.HasValue.ValueChangeListener<E extends com.vaadin.flow.component.HasValue.ValueChangeEvent<?>>HasClientValidation.ClientValidatedEvent| Constructor and Description |
|---|
RadioButtonGroup() |
| Modifier and Type | Method and Description |
|---|---|
com.vaadin.flow.shared.Registration |
addValidationStatusChangeListener(com.vaadin.flow.data.binder.ValidationStatusChangeListener<T> listener) |
com.vaadin.flow.data.provider.DataProvider<T,?> |
getDataProvider()
Gets the data provider.
|
String |
getErrorMessage()
Gets the current error message from the radio button group.
|
com.vaadin.flow.function.SerializablePredicate<T> |
getItemEnabledProvider()
Returns the item enabled predicate.
|
com.vaadin.flow.data.renderer.ComponentRenderer<? extends com.vaadin.flow.component.Component,T> |
getItemRenderer()
Returns the item component renderer.
|
String |
getLabel()
String used for the label element.
|
protected boolean |
hasValidValue() |
protected boolean |
isEnforcedFieldValidationEnabled() |
boolean |
isInvalid() |
boolean |
isReadOnly() |
boolean |
isRequired()
Specifies that the user must select a value
|
protected void |
onAttach(com.vaadin.flow.component.AttachEvent attachEvent) |
protected void |
onDetach(com.vaadin.flow.component.DetachEvent detachEvent) |
void |
onEnabledStateChanged(boolean enabled) |
void |
setDataProvider(com.vaadin.flow.data.provider.DataProvider<T,?> dataProvider) |
void |
setErrorMessage(String errorMessage)
Description copied from corresponding location in WebComponent:
|
void |
setInvalid(boolean invalid)
Description copied from corresponding location in WebComponent:
|
void |
setItemEnabledProvider(com.vaadin.flow.function.SerializablePredicate<T> itemEnabledProvider)
Sets the item enabled predicate for this radio button group.
|
void |
setLabel(String label)
Sets the label for the field.
|
void |
setReadOnly(boolean readOnly) |
void |
setRenderer(com.vaadin.flow.data.renderer.ComponentRenderer<? extends com.vaadin.flow.component.Component,T> renderer)
Sets the item renderer for this radio button group.
|
void |
setRequired(boolean required)
Specifies that the user must select in a value.
|
void |
setValue(T value) |
protected void |
validate()
Description copied from corresponding location in WebComponent:
|
addInvalidChangeListener, addThemeVariants, checkValidity, getErrorMessageString, getLabelString, isDisabledBoolean, isInvalidBoolean, isReadonlyBoolean, isRequiredBoolean, removeThemeVariants, setDisabled, setReadonlygetSynchronizationRegistration, setPresentationValue, setSynchronizedEventaddValueChangeListener, getEmptyValue, getValue, isEmpty, setModelValue, valueEqualsaddListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, set, setElement, setId, setVisibleclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddComponents, getItemPosition, prependComponentsadd, add, addComponentAsFirst, addComponentAtIndex, remove, removeAllisRequiredIndicatorVisible, setRequiredIndicatorVisibleaddValueChangeListener, clear, getEmptyValue, getOptionalValue, getValue, isEmptygetHelperComponent, getHelperText, setHelperComponent, setHelperTextaddClientValidatedEventListeneraddClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameprotected boolean hasValidValue()
hasValidValue in class com.vaadin.flow.component.AbstractSinglePropertyField<RadioButtonGroup<T>,T>public void setDataProvider(com.vaadin.flow.data.provider.DataProvider<T,?> dataProvider)
setDataProvider in interface com.vaadin.flow.data.binder.HasDataProvider<T>public void setValue(T value)
setValue in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<RadioButtonGroup<T>,T>,T>setValue in class com.vaadin.flow.component.AbstractField<RadioButtonGroup<T>,T>protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent)
onAttach in class com.vaadin.flow.component.Componentprotected void onDetach(com.vaadin.flow.component.DetachEvent detachEvent)
onDetach in class com.vaadin.flow.component.Componentpublic com.vaadin.flow.data.provider.DataProvider<T,?> getDataProvider()
nullpublic com.vaadin.flow.function.SerializablePredicate<T> getItemEnabledProvider()
setItemEnabledProvider(com.vaadin.flow.function.SerializablePredicate<T>)public void setItemEnabledProvider(com.vaadin.flow.function.SerializablePredicate<T> itemEnabledProvider)
true) or disabled (false). Disabled items are
displayed as grayed out and the user cannot select them. The default
predicate always returns true (all the items are enabled).itemEnabledProvider - the item enable predicate, not nullpublic com.vaadin.flow.data.renderer.ComponentRenderer<? extends com.vaadin.flow.component.Component,T> getItemRenderer()
setRenderer(ComponentRenderer)public void setRenderer(com.vaadin.flow.data.renderer.ComponentRenderer<? extends com.vaadin.flow.component.Component,T> renderer)
Note: Component acts as a label to the button and clicks on it trigger the radio button. Hence interactive components like DatePicker or ComboBox cannot be used.
renderer - the item renderer, not nullpublic void onEnabledStateChanged(boolean enabled)
onEnabledStateChanged in class com.vaadin.flow.component.Componentpublic void setReadOnly(boolean readOnly)
setReadOnly in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<RadioButtonGroup<T>,T>,T>setReadOnly in interface com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<RadioButtonGroup<T>,T>,T>public boolean isReadOnly()
isReadOnly in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<RadioButtonGroup<T>,T>,T>isReadOnly in interface com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<RadioButtonGroup<T>,T>,T>public void setRequired(boolean required)
NOTE: The required indicator will not be visible, if there is no
label property set for the radiobutton group.
setRequired in class GeneratedVaadinRadioGroup<RadioButtonGroup<T>,T>required - the boolean value to setpublic boolean isRequired()
This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.
required property from the webcomponentpublic void setErrorMessage(String errorMessage)
GeneratedVaadinRadioGroupDescription copied from corresponding location in WebComponent:
Error to show when the input value is invalid.
setErrorMessage in interface com.vaadin.flow.component.HasValidationsetErrorMessage in class GeneratedVaadinRadioGroup<RadioButtonGroup<T>,T>errorMessage - the String value to setpublic String getErrorMessage()
getErrorMessage in interface com.vaadin.flow.component.HasValidationpublic void setLabel(String label)
setLabel in interface com.vaadin.flow.component.HasLabelsetLabel in class GeneratedVaadinRadioGroup<RadioButtonGroup<T>,T>label - value for the label property in the webcomponentpublic String getLabel()
getLabel in interface com.vaadin.flow.component.HasLabellabel property from the webcomponentpublic boolean isInvalid()
isInvalid in interface com.vaadin.flow.component.HasValidationpublic void setInvalid(boolean invalid)
GeneratedVaadinRadioGroupDescription copied from corresponding location in WebComponent:
This property is set to true when the value is invalid.
setInvalid in interface com.vaadin.flow.component.HasValidationsetInvalid in class GeneratedVaadinRadioGroup<RadioButtonGroup<T>,T>invalid - the boolean value to setprotected void validate()
GeneratedVaadinRadioGroupDescription copied from corresponding location in WebComponent:
Returns true if value is valid. <iron-form> uses this to
check the validity or all its elements.
This function is not supported by Flow because it returns a
boolean. Functions with return types different than void are
not supported at this moment.
validate in class GeneratedVaadinRadioGroup<RadioButtonGroup<T>,T>public com.vaadin.flow.shared.Registration addValidationStatusChangeListener(com.vaadin.flow.data.binder.ValidationStatusChangeListener<T> listener)
addValidationStatusChangeListener in interface com.vaadin.flow.data.binder.HasValidator<T>protected boolean isEnforcedFieldValidationEnabled()
Copyright © 2025. All rights reserved.