Package com.storedobject.ui
Class ObjectField<T extends StoredObject>
java.lang.Object
- Type Parameters:
T
- Type of objects accepted. OnlyId
values of this type are valid.
- All Implemented Interfaces:
FilterMethods<T>
,ObjectGetter<T>
,ObjectSetter<T>
,IdInput<T>
,ObjectProvider<T>
,AbstractObjectInput<T>
,NoDisplayField
,HasElement
,HasThemeStyle
,ValueRequired
,ViewDependent
,com.vaadin.flow.component.AttachNotifier
,com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.customfield.CustomField<Id>>
,com.vaadin.flow.component.DetachNotifier
,com.vaadin.flow.component.Focusable<com.vaadin.flow.component.customfield.CustomField<Id>>
,com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.customfield.CustomField<Id>>
,com.vaadin.flow.component.HasElement
,com.vaadin.flow.component.HasEnabled
,com.vaadin.flow.component.HasHelper
,com.vaadin.flow.component.HasLabel
,com.vaadin.flow.component.HasPlaceholder
,com.vaadin.flow.component.HasSize
,com.vaadin.flow.component.HasStyle
,com.vaadin.flow.component.HasTheme
,com.vaadin.flow.component.HasValidation
,com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<Id>,
,Id>, Id> com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<Id>,
,Id>, Id> com.vaadin.flow.component.shared.HasTooltip
,com.vaadin.flow.component.shared.HasValidationProperties
,com.vaadin.flow.component.shared.InputField<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<Id>,
,Id>, Id> Serializable
,Consumer<T>
- Direct Known Subclasses:
AccountField
,UserField
public class ObjectField<T extends StoredObject>
extends CustomField<Id>
implements IdInput<T>, ViewDependent, NoDisplayField, ValueRequired
A field that can be used to accept
Id
values. It has an "internal field" of type ObjectInput
that actually accepts the object values.- Author:
- Syam
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField
com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C extends com.vaadin.flow.component.Component,
V> Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier
com.vaadin.flow.component.BlurNotifier.BlurEvent<C extends com.vaadin.flow.component.Component>
Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier
com.vaadin.flow.component.FocusNotifier.FocusEvent<C extends com.vaadin.flow.component.Component>
Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue
com.vaadin.flow.component.HasValue.ValueChangeEvent<V>, com.vaadin.flow.component.HasValue.ValueChangeListener<E extends com.vaadin.flow.component.HasValue.ValueChangeEvent<?>>
-
Constructor Summary
ConstructorsModifierConstructorDescriptionObjectField
(ObjectInput<T> field) Constructor.ObjectField
(Class<T> objectClass) Constructor.ObjectField
(Class<T> objectClass, boolean any) Constructor.ObjectField
(Class<T> objectClass, boolean any, boolean addAllowed) Constructor.ObjectField
(Class<T> objectClass, boolean any, ObjectField.Type type) Constructor.ObjectField
(Class<T> objectClass, boolean any, ObjectField.Type type, boolean addAllowed) Constructor.ObjectField
(Class<T> objectClass, ObjectField.Type type) Constructor.ObjectField
(Iterable<T> list) Constructor.ObjectField
(String label, ObjectInput<T> field) Constructor.ObjectField
(String label, Class<T> objectClass) Constructor.ObjectField
(String label, Class<T> objectClass, boolean any) Constructor.ObjectField
(String label, Class<T> objectClass, boolean any, boolean addAllowed) Constructor.ObjectField
(String label, Class<T> objectClass, boolean any, ObjectField.Type type) Constructor.ObjectField
(String label, Class<T> objectClass, boolean any, ObjectField.Type type, boolean addAllowed) Constructor.protected
ObjectField
(String label, Class<T> objectClass, boolean any, ObjectGetField.GetProvider<T> getProvider, boolean addAllowed) Constructor.ObjectField
(String label, Class<T> objectClass, ObjectField.Type type) Constructor.ObjectField
(String label, Class<T> objectClass, String fieldName, BiFunction<String, Class<T>, ObjectEditor<T>> editorCreator, boolean any, ObjectField.Type type, boolean addAllowed) Constructor.Constructor.ObjectField
(String label, Iterable<T> list) Constructor.ObjectField
(String label, List<T> list) Constructor.ObjectField
(String label, List<T> list, boolean any) Constructor.ObjectField
(List<T> list) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method is called whenever a filter condition is changed.boolean
Can this field display information like normal fields?static <O extends StoredObject>
ObjectField<O> createSingle
(String label, O object) Create a read-only instance of theObjectField
that has a pre-selected value.void
Deprecated.void
focus()
Focus this field.protected Id
Get the currently cached object.Get the dependent view.com.vaadin.flow.component.Component
Get the component that is currently displaying details of the object value.Get the consumer that is currently consuming details of the object value.getField()
Get the internal field.Get the load filter.Class of the object supported in this input field.getType()
Get the type of the internal field.getValue()
Get the value.boolean
Whether this field allows any derived object values or not.boolean
boolean
Get the value required flag.void
load
(ObjectIterator<T> objects) Load allowed values from a list.void
reload()
Reload the allowed values by applying newly set filters.void
Cache an object instance.void
setDependentView
(View dependent) Set the dependent view.void
setDetailComponent
(com.vaadin.flow.component.Component detailComponent) Set a component that will display details of the object value.void
setDisplayDetail
(Consumer<T> displayDetail) Set a consumer that can display/consume the details of the object value.void
setEnabled
(boolean enabled) Enable/disable this field.void
void
setItemLabelGenerator
(com.vaadin.flow.component.ItemLabelGenerator<T> itemLabelGenerator) Set an "item label generator" that returns the string value of the object value of this field.void
void
setLoadFilter
(Predicate<T> loadFilter) Set a filter predicate that will be used while loading.void
setLoadFilter
(Predicate<T> loadFilter, boolean apply) Set the load filter.void
setMaxWidth
(String width) void
setMinWidth
(String width) void
setNotFoundHandler
(Function<String, T> notFoundHandler) void
Set object for the givenId
.void
setObject
(StoredObject object) Set a raw object as the value.final void
setObjectClass
(Class<? extends T>... classes) Set one or more (typically more than one) class subtypes that this field supports.void
setPlaceholder
(String placeholder) void
setPrefixFieldControl
(boolean searchFieldControl) Decide whether "prefix components" needs to be controlled by this field or not.protected void
setPresentationValue
(Id value) void
setReadOnly
(boolean readOnly) Make this field read-only.void
setRequired
(boolean required) Set value required flag.void
Set the value.void
Set the value for the given object.void
void
protected void
Methods inherited from class com.storedobject.vaadin.CustomField
addField, addField
Methods inherited from class com.vaadin.flow.component.customfield.CustomField
add, addThemeVariants, getLabel, onAttach, remove, removeThemeVariants
Methods inherited from class com.vaadin.flow.component.AbstractField
addValueChangeListener, getEmptyValue, isEmpty, setModelValue, valueEquals
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, 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.storedobject.ui.util.AbstractObjectInput
applyFilterPredicate, convert, getObject, getObjectId
Methods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListener
Methods inherited from interface com.vaadin.flow.component.BlurNotifier
addBlurListener
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
Methods inherited from interface com.storedobject.core.FilterMethods
getEffectiveCondition, getFilterCondition, setFilter, setFilter, setFilter, setFilter, setFilter, setFilter, setViewFilter, setViewFilter
Methods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, blur, getTabIndex, setTabIndex
Methods inherited from interface com.vaadin.flow.component.FocusNotifier
addFocusListener
Methods inherited from interface com.storedobject.vaadin.HasElement
getAttribute, getStyle, setAttribute, setStyle
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
Methods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled
Methods inherited from interface com.vaadin.flow.component.HasHelper
getHelperComponent, getHelperText, setHelperComponent, setHelperText
Methods inherited from interface com.vaadin.flow.component.HasLabel
getLabel
Methods inherited from interface com.vaadin.flow.component.HasPlaceholder
getPlaceholder
Methods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setSizeFull, setSizeUndefined, setWidth
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.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName
Methods inherited from interface com.storedobject.vaadin.HasThemeStyle
addTheme, asPrimary, asSmall, clearThemes, getInternalElement, removeTheme, setTheme
Methods inherited from interface com.vaadin.flow.component.shared.HasTooltip
getTooltip, setTooltipText
Methods inherited from interface com.vaadin.flow.component.HasValidation
setManualValidation
Methods inherited from interface com.vaadin.flow.component.shared.HasValidationProperties
getErrorMessage, setErrorMessage, setInvalid
Methods inherited from interface com.vaadin.flow.component.HasValue
addValueChangeListener, clear, getEmptyValue, getOptionalValue, isEmpty
Methods inherited from interface com.vaadin.flow.component.HasValueAndElement
isReadOnly, isRequiredIndicatorVisible, setRequiredIndicatorVisible
Methods inherited from interface com.storedobject.ui.IdInput
getObject, getObjectId
Methods inherited from interface com.storedobject.core.ObjectSetter
accept
-
Constructor Details
-
ObjectField
-
ObjectField
Constructor.- Parameters:
objectClass
- Class of the objects that are valid.type
- Desired type of the field.
-
ObjectField
-
ObjectField
Constructor.- Parameters:
label
- Label for the field.objectClass
- Class of the objects that are valid.type
- Desired type of the field.
-
ObjectField
-
ObjectField
-
ObjectField
Constructor.- Parameters:
objectClass
- Class of the objects that are valid.any
- Whether subclasses should be allowed or not.type
- Desired type of the field.
-
ObjectField
Constructor.- Parameters:
label
- Label for the field.objectClass
- Class of the objects that are valid.any
- Whether subclasses should be allowed or not.type
- Desired type of the field.
-
ObjectField
Constructor.- Parameters:
objectClass
- Class of the objects that are valid.any
- Whether subclasses should be allowed or not.addAllowed
- Whether new object instances can be added via this field or not. (This feature is available only in certain field types).
-
ObjectField
Constructor.- Parameters:
label
- Label for the field.objectClass
- Class of the objects that are valid.any
- Whether subclasses should be allowed or not.addAllowed
- Whether new object instances can be added via this field or not. (This feature is available only in certain field types).
-
ObjectField
Constructor.- Parameters:
objectClass
- Class of the objects that are valid.any
- Whether subclasses should be allowed or not.type
- Desired type of the field.addAllowed
- Whether new object instances can be added via this field or not. (This feature is available only in certain field types).
-
ObjectField
public ObjectField(String label, Class<T> objectClass, boolean any, ObjectField.Type type, boolean addAllowed) Constructor.- Parameters:
label
- Label for the field.objectClass
- Class of the objects that are valid.any
- Whether subclasses should be allowed or not.type
- Desired type of the field.addAllowed
- Whether new object instances can be added via this field or not. (This feature is available only in certain field types).
-
ObjectField
public ObjectField(String label, Class<T> objectClass, String fieldName, BiFunction<String, Class<T>, ObjectEditor<T>> editorCreator, boolean any, ObjectField.Type type, boolean addAllowed) Constructor.- Parameters:
label
- Label for the field.objectClass
- Class of the objects that are valid.fieldName
- Name of the field (Useful when crated from anObjectEditor
).editorCreator
- Editor creator for theObjectFormField
. (Useful when the type isObjectField.Type.FORM
orObjectField.Type.FORM_BLOCK
).any
- Whether subclasses should be allowed or not.type
- Desired type of the field.addAllowed
- Whether new object instances can be added via this field or not. (This feature is available only in certain field types).
-
ObjectField
-
ObjectField
-
ObjectField
-
ObjectField
protected ObjectField(String label, Class<T> objectClass, boolean any, ObjectGetField.GetProvider<T> getProvider, boolean addAllowed) Constructor.- Parameters:
label
- Label for the field.objectClass
- Class of the objects that are valid.any
- Whether subclasses should be allowed or not.getProvider
- "Get" provider for searching the object instances.addAllowed
- Whether new object instances can be added via this field or not. (This feature is available only in certain field types).
-
ObjectField
-
ObjectField
-
ObjectField
-
ObjectField
Constructor.- Parameters:
field
- Object input field to be used internally.
-
ObjectField
Constructor.- Parameters:
label
- Label for the field.field
- Object input field to be used internally.
-
-
Method Details
-
filter
Deprecated.Please usesetFilter(Predicate)
instead.Set a predicate that will be used for filtering the object after loading is done.- Parameters:
predicate
- Filter to apply after loaded.
-
setFilter
-
setLoadFilter
Set a filter predicate that will be used while loading.- Specified by:
setLoadFilter
in interfaceFilterMethods<T extends StoredObject>
- Parameters:
loadFilter
- Filter to apply while loading.
-
setLoadFilter
Description copied from interface:FilterMethods
Set the load filter. This will be applied whenever loading takes place.- Specified by:
setLoadFilter
in interfaceFilterMethods<T extends StoredObject>
- Parameters:
loadFilter
- Load filter to be applied while loading.apply
- Whether to apply it immediately or not.
-
focus
public void focus()Description copied from interface:AbstractObjectInput
Focus this field.- Specified by:
focus
in interfaceAbstractObjectInput<T extends StoredObject>
- Specified by:
focus
in interfacecom.vaadin.flow.component.Focusable<T extends StoredObject>
- Overrides:
focus
in classCustomField<Id>
-
setWidth
- Specified by:
setWidth
in interfacecom.vaadin.flow.component.HasSize
-
setWidthFull
public void setWidthFull()- Specified by:
setWidthFull
in interfacecom.vaadin.flow.component.HasSize
-
setMaxWidth
- Specified by:
setMaxWidth
in interfacecom.vaadin.flow.component.HasSize
-
setMinWidth
- Specified by:
setMinWidth
in interfacecom.vaadin.flow.component.HasSize
-
setLabel
-
canDisplay
public boolean canDisplay()Description copied from interface:NoDisplayField
Can this field display information like normal fields?- Specified by:
canDisplay
in interfaceNoDisplayField
- Returns:
- True/false.
-
updateValue
protected void updateValue()- Overrides:
updateValue
in classcom.vaadin.flow.component.customfield.CustomField<Id>
-
isInvalid
public boolean isInvalid()- Specified by:
isInvalid
in interfacecom.vaadin.flow.component.HasValidation
- Specified by:
isInvalid
in interfacecom.vaadin.flow.component.shared.HasValidationProperties
-
setPlaceholder
- Specified by:
setPlaceholder
in interfacecom.vaadin.flow.component.HasPlaceholder
-
getCached
Description copied from interface:AbstractObjectInput
Get the currently cached object.- Specified by:
getCached
in interfaceAbstractObjectInput<T extends StoredObject>
- Returns:
- Object that is currently cached. It may return
null
.
-
setCached
Description copied from interface:AbstractObjectInput
Cache an object instance. Default implementation doesn't do anything but a field may cache it and re-used for eliminating unwanted database access.- Specified by:
setCached
in interfaceAbstractObjectInput<T extends StoredObject>
- Parameters:
object
- Object to be cached.
-
getObjectClass
Description copied from interface:AbstractObjectInput
Class of the object supported in this input field.- Specified by:
getObjectClass
in interfaceAbstractObjectInput<T extends StoredObject>
- Specified by:
getObjectClass
in interfaceObjectGetter<T extends StoredObject>
- Specified by:
getObjectClass
in interfaceObjectProvider<T extends StoredObject>
- Specified by:
getObjectClass
in interfaceObjectSetter<T extends StoredObject>
- Returns:
- Class of the supported object.
-
applyFilter
public void applyFilter()Description copied from interface:FilterMethods
This method is called whenever a filter condition is changed. Methods with default implementation already invoke this method. If any of those methods are overridden, make sure that it invokes this method so that logic to handle filter changes can be coded here.- Specified by:
applyFilter
in interfaceFilterMethods<T extends StoredObject>
-
getLoadFilter
Description copied from interface:FilterMethods
Get the load filter.- Specified by:
getLoadFilter
in interfaceFilterMethods<T extends StoredObject>
- Returns:
- Current load filter.
-
setDetailComponent
public void setDetailComponent(com.vaadin.flow.component.Component detailComponent) Description copied from interface:AbstractObjectInput
Set a component that will display details of the object value.- Specified by:
setDetailComponent
in interfaceAbstractObjectInput<T extends StoredObject>
- Parameters:
detailComponent
- A component that can display information regarding the object.
-
getDetailComponent
public com.vaadin.flow.component.Component getDetailComponent()Description copied from interface:AbstractObjectInput
Get the component that is currently displaying details of the object value.- Specified by:
getDetailComponent
in interfaceAbstractObjectInput<T extends StoredObject>
- Returns:
- Component that is displaying the details.
-
setDisplayDetail
Description copied from interface:AbstractObjectInput
Set a consumer that can display/consume the details of the object value.- Specified by:
setDisplayDetail
in interfaceAbstractObjectInput<T extends StoredObject>
- Parameters:
displayDetail
- A consumer that can accept the object value.
-
getDisplayDetail
Description copied from interface:AbstractObjectInput
Get the consumer that is currently consuming details of the object value.- Specified by:
getDisplayDetail
in interfaceAbstractObjectInput<T extends StoredObject>
- Returns:
- Consumer that is currently set.
-
setPrefixFieldControl
public void setPrefixFieldControl(boolean searchFieldControl) Description copied from interface:AbstractObjectInput
Decide whether "prefix components" needs to be controlled by this field or not. "Prefix components" are parts of the field that display extra information, and it needs to be turned on or off when the status of the field changes via methods such asAbstractObjectInput.setEnabled(boolean)
,AbstractObjectInput.setReadOnly(boolean)
etc. In some cases, prefix components may be displayed elsewhere and needs to be controlled outside the field.- Specified by:
setPrefixFieldControl
in interfaceAbstractObjectInput<T extends StoredObject>
- Parameters:
searchFieldControl
- True if it needs to be controlled by this field.
-
isAllowAny
public boolean isAllowAny()Description copied from interface:AbstractObjectInput
Whether this field allows any derived object values or not.- Specified by:
isAllowAny
in interfaceAbstractObjectInput<T extends StoredObject>
- Specified by:
isAllowAny
in interfaceObjectGetter<T extends StoredObject>
- Specified by:
isAllowAny
in interfaceObjectSetter<T extends StoredObject>
- Returns:
- True or false.
-
setReadOnly
public void setReadOnly(boolean readOnly) Description copied from interface:AbstractObjectInput
Make this field read-only.- Specified by:
setReadOnly
in interfaceAbstractObjectInput<T extends StoredObject>
- Specified by:
setReadOnly
in interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<Id>,
Id>, Id> - Specified by:
setReadOnly
in interfacecom.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<Id>,
Id>, Id> - Parameters:
readOnly
- True to set as read-only.
-
setEnabled
public void setEnabled(boolean enabled) Description copied from interface:AbstractObjectInput
Enable/disable this field.- Specified by:
setEnabled
in interfaceAbstractObjectInput<T extends StoredObject>
- Specified by:
setEnabled
in interfacecom.vaadin.flow.component.HasEnabled
- Parameters:
enabled
- True for enabling.
-
getField
Get the internal field.- Returns:
- The internal field that is accepting the object values.
-
generateModelValue
-
setPresentationValue
-
getType
Get the type of the internal field.- Returns:
- Type of the internal field.
-
setItemLabelGenerator
public void setItemLabelGenerator(com.vaadin.flow.component.ItemLabelGenerator<T> itemLabelGenerator) Description copied from interface:AbstractObjectInput
Set an "item label generator" that returns the string value of the object value of this field. (It is mainly used to display the object).- Specified by:
setItemLabelGenerator
in interfaceAbstractObjectInput<T extends StoredObject>
- Parameters:
itemLabelGenerator
- Item value generator.
-
getValue
Description copied from interface:IdInput
Get the value.- Specified by:
getValue
in interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<Id>,
Id>, Id> - Specified by:
getValue
in interfaceIdInput<T extends StoredObject>
- Overrides:
getValue
in classcom.vaadin.flow.component.AbstractField<com.vaadin.flow.component.customfield.CustomField<Id>,
Id> - Returns:
- Value.
-
setDependentView
Description copied from interface:ViewDependent
Set the dependent view.- Specified by:
setDependentView
in interfaceViewDependent
- Parameters:
dependent
- The dependent view.
-
setValue
Description copied from interface:IdInput
Set the value.- Specified by:
setValue
in interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<Id>,
Id>, Id> - Specified by:
setValue
in interfaceIdInput<T extends StoredObject>
- Overrides:
setValue
in classcom.vaadin.flow.component.AbstractField<com.vaadin.flow.component.customfield.CustomField<Id>,
Id> - Parameters:
value
- Value to set.
-
setValue
-
setObject
Description copied from interface:AbstractObjectInput
Set object for the givenId
.- Specified by:
setObject
in interfaceAbstractObjectInput<T extends StoredObject>
- Specified by:
setObject
in interfaceObjectSetter<T extends StoredObject>
- Parameters:
objectId
-Id
of the object to be set.
-
setObject
Description copied from interface:IdInput
Set a raw object as the value. If the object is not convertible to the supported type, it will setnull
value.- Specified by:
setObject
in interfaceAbstractObjectInput<T extends StoredObject>
- Specified by:
setObject
in interfaceIdInput<T extends StoredObject>
- Specified by:
setObject
in interfaceObjectSetter<T extends StoredObject>
- Parameters:
object
- Object to set.
-
getDependentView
Description copied from interface:ViewDependent
Get the dependent view.- Specified by:
getDependentView
in interfaceViewDependent
- Returns:
- The dependent view.
-
load
Load allowed values from a list. Once invoked, only this list will be used for showing the allowed objects that can be selected via this field.- Parameters:
objects
- Objects to load.
-
reload
public void reload()Reload the allowed values by applying newly set filters. -
setObjectClass
Set one or more (typically more than one) class subtypes that this field supports.- Parameters:
classes
- Classes to allow.
-
createSingle
Create a read-only instance of theObjectField
that has a pre-selected value.- Type Parameters:
O
- Type of the object accepted.- Parameters:
label
- Field label.object
- Pre-selected value. (Must be non-null).- Returns:
- A read-only field with value already set.
-
setNotFoundHandler
-
setRequired
public void setRequired(boolean required) Description copied from interface:ValueRequired
Set value required flag.- Specified by:
setRequired
in interfaceValueRequired
- Parameters:
required
- Required or not
-
isRequired
public boolean isRequired()Description copied from interface:ValueRequired
Get the value required flag.- Specified by:
isRequired
in interfaceValueRequired
- Returns:
- Whether required or not.
-
setFilter(Predicate)
instead.