Package org.vaadin.firitin.fields
Class ElementCollectionField<T>
- java.lang.Object
-
- com.vaadin.flow.component.Component
-
- com.vaadin.flow.component.Composite<com.vaadin.flow.component.orderedlayout.VerticalLayout>
-
- org.vaadin.firitin.fields.ElementCollectionField<T>
-
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasValue<com.vaadin.flow.component.HasValue.ValueChangeEvent<List<T>>,List<T>>,Serializable
public class ElementCollectionField<T> extends com.vaadin.flow.component.Composite<com.vaadin.flow.component.orderedlayout.VerticalLayout> implements com.vaadin.flow.component.HasValue<com.vaadin.flow.component.HasValue.ValueChangeEvent<List<T>>,List<T>>, com.vaadin.flow.component.HasSize
A field to pick a list of objects from a superset.Usage example: selecting runners to a relay team.
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue
com.vaadin.flow.component.HasValue.ValueChangeEvent<V extends Object>, com.vaadin.flow.component.HasValue.ValueChangeListener<E extends com.vaadin.flow.component.HasValue.ValueChangeEvent<?>>
-
-
Constructor Summary
Constructors Constructor Description ElementCollectionField(Class<T> clazz, Class<?> editorClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddDeleteButtonColumn(TableRow row, T item)com.vaadin.flow.shared.RegistrationaddValueChangeListener(com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.HasValue.ValueChangeEvent<List<T>>> listener)protected voidconfigureColumneHeaders()protected StringgetHeaderForField(String fieldName)Translatest raw field name to header name.List<T>getValue()protected TinstantiateNewItem()booleanisReadOnly()booleanisRequiredIndicatorVisible()voidsetReadOnly(boolean readOnly)voidsetRequiredIndicatorVisible(boolean requiredIndicatorVisible)voidsetValue(List<T> value)ElementCollectionField<T>withEditorInstantiator(com.vaadin.flow.function.SerializableSupplier<Object> editorInstantiator)-
Methods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElement, initContent
-
Methods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, 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.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
-
-
-
-
Field Detail
-
table
protected Table table
-
-
Method Detail
-
withEditorInstantiator
public ElementCollectionField<T> withEditorInstantiator(com.vaadin.flow.function.SerializableSupplier<Object> editorInstantiator)
-
configureColumneHeaders
protected void configureColumneHeaders()
-
getHeaderForField
protected String getHeaderForField(String fieldName)
Translatest raw field name to header name. By default decamelcases the name. Override for e.g. localization.- Parameters:
fieldName- the raw field name of the row property- Returns:
- a string to be used as a header in the editor
-
instantiateNewItem
protected T instantiateNewItem()
-
addValueChangeListener
public com.vaadin.flow.shared.Registration addValueChangeListener(com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.HasValue.ValueChangeEvent<List<T>>> listener)
-
setReadOnly
public void setReadOnly(boolean readOnly)
-
isReadOnly
public boolean isReadOnly()
-
setRequiredIndicatorVisible
public void setRequiredIndicatorVisible(boolean requiredIndicatorVisible)
-
-