Binder and
BeanValidationBinder@Deprecated public class BeanFieldGroup<T> extends FieldGroup
FieldGroup.BindException, FieldGroup.CommitEvent, FieldGroup.CommitException, FieldGroup.CommitHandler, FieldGroup.FieldGroupInvalidValueException, FieldGroup.SearchException| Constructor and Description |
|---|
BeanFieldGroup(Class<T> beanType)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
bind(Field field,
Object propertyId)
Deprecated.
Binds the field with the given propertyId from the current item.
|
static <T> BeanFieldGroup<T> |
bindFieldsBuffered(T bean,
Object objectWithMemberFields)
Deprecated.
Convenience method to bind Fields from a given "field container" to a
given bean with buffering enabled.
|
static <T> BeanFieldGroup<T> |
bindFieldsUnbuffered(T bean,
Object objectWithMemberFields)
Deprecated.
Convenience method to bind Fields from a given "field container" to a
given bean with buffering disabled.
|
<T extends Field> |
buildAndBind(String caption,
Object propertyId,
Class<T> fieldType)
Deprecated.
Builds a field using the given caption and binds it to the given property
id using the field binder.
|
protected void |
configureField(Field<?> field)
Deprecated.
Configures a field with the settings set for this FieldBinder.
|
protected Object |
findPropertyId(Field memberField)
Deprecated.
Searches for a property id from the current itemDataSource that matches
the given memberField.
|
BeanItem<T> |
getItemDataSource()
Deprecated.
Gets the item used by this FieldBinder.
|
protected Class<?> |
getPropertyType(Object propertyId)
Deprecated.
Gets the type of the property with the given property id.
|
protected static boolean |
isBeanValidationImplementationAvailable()
Deprecated.
Checks whether a bean validation implementation (e.g.
|
void |
setItemDataSource(Item item)
Deprecated.
Updates the item that is used by this FieldBinder.
|
void |
setItemDataSource(T bean)
Deprecated.
Helper method for setting the data source directly using a bean.
|
void |
unbind(Field<?> field)
Deprecated.
Detaches the field from its property id and removes it from this
FieldBinder.
|
addCommitHandler, bindFields, bindMemberFields, build, buildAndBind, buildAndBind, buildAndBindMemberFields, buildAndBindMemberFields, clear, clearField, commit, discard, getBoundPropertyIds, getCommitHandlers, getField, getFieldFactory, getFields, getFieldsInDeclareOrder, getItemProperty, getPropertyId, getUnboundPropertyIds, isBuffered, isEnabled, isModified, isReadOnly, isValid, minifyFieldName, removeCommitHandler, setBuffered, setEnabled, setFieldFactory, setReadOnly, wrapInTransactionalPropertyprotected Class<?> getPropertyType(Object propertyId)
FieldGroupgetPropertyType in class FieldGrouppropertyId - The propertyId. Must be findprotected Object findPropertyId(Field memberField)
FieldGroupIf perfect match is not found, uses a case insensitive search that also ignores underscores. Returns null if no match is found. Throws a SearchException if no item data source has been set.
The propertyId search logic used by
buildAndBindMemberFields can easily be customized by overriding this
method. No other changes are needed.
findPropertyId in class FieldGroupmemberField - The field an object id is searched forpublic void setItemDataSource(T bean)
BeanItem and calls
setItemDataSource(Item).
For null values, a null item is passed to
setItemDataSource(Item) to be properly clear fields.
bean - The bean to use as data source.public void setItemDataSource(Item item)
FieldGroupsetItemDataSource in class FieldGroupitem - The new item to usepublic BeanItem<T> getItemDataSource()
FieldGroupFieldGroup.commit() for the item to be updated unless buffered mode has
been switched off.getItemDataSource in class FieldGroupFieldGroup.setBuffered(boolean),
FieldGroup.commit()public void bind(Field field, Object propertyId)
FieldGroupFieldGroup.setItemDataSource(Item).
This method also adds validators when applicable.
bind in class FieldGroupfield - The field to bindpropertyId - The propertyId to bind to the fieldpublic <T extends Field> T buildAndBind(String caption, Object propertyId, Class<T> fieldType) throws FieldGroup.BindException
FieldGroupbuildAndBind in class FieldGroupcaption - The caption for the fieldpropertyId - The property id to bind to. Must be present in the field
finder.Field.FieldGroup.BindException - If the field could not be createdpublic void unbind(Field<?> field) throws FieldGroup.BindException
FieldGroupNote that the field is not detached from its property data source if it is no longer connected to the same property id it was bound to using this FieldBinder.
unbind in class FieldGroupfield - The field to detachFieldGroup.BindException - If the field is not bound by this field binder or not bound
to the correct property idprotected void configureField(Field<?> field)
FieldGroupBy default this updates the buffered, read only and enabled state of the field. Also adds validators when applicable. Fields with read only data source are always configured as read only.
configureField in class FieldGroupfield - The field to updateprotected static boolean isBeanValidationImplementationAvailable()
public static <T> BeanFieldGroup<T> bindFieldsUnbuffered(T bean, Object objectWithMemberFields)
The returned BeanFieldGroup can be used for further
configuration.
bean - the bean to be boundobjectWithMemberFields - the class that contains Fields for bean propertiesbindFieldsBuffered(Object, Object),
FieldGroup.bindMemberFields(Object)public static <T> BeanFieldGroup<T> bindFieldsBuffered(T bean, Object objectWithMemberFields)
The returned BeanFieldGroup can be used for further
configuration.
bean - the bean to be boundobjectWithMemberFields - the class that contains Fields for bean propertiesbindFieldsUnbuffered(Object, Object),
FieldGroup.bindMemberFields(Object)Copyright © 2019 Vaadin Ltd. All rights reserved.