com.vaadin.ui
Interface Field<T>

All Superinterfaces:
Buffered, BufferedValidatable, ClientConnector, Component, Component.Focusable, com.vaadin.shared.Connector, Property<T>, Property.Editor, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer, java.io.Serializable, Sizeable, Validatable
All Known Implementing Classes:
AbstractField, AbstractSelect, AbstractTextField, CheckBox, ComboBox, CustomField, DateField, Form, InlineDateField, ListSelect, NativeSelect, OptionGroup, PasswordField, PopupDateField, ProgressBar, ProgressIndicator, RichTextArea, Select, Slider, Table, TextArea, TextField, Tree, TreeTable, TwinColSelect

public interface Field<T>
extends Component, BufferedValidatable, Property<T>, Property.ValueChangeNotifier, Property.ValueChangeListener, Property.Editor, Component.Focusable

Field interface is implemented by all classes (field components) that have a value that the user can change through the user interface. Field components are built upon the framework defined in the Field interface and the com.vaadin.AbstractField base class. The Field interface inherits the Component superinterface and also the com.vaadin.ui.Property interface to have a value for the field.

Author:
Vaadin Ltd., IT Mill Ltd.

Nested Class Summary
static class Field.ValueChangeEvent
          An Event object specifying the Field whose value has been changed.
 
Nested classes/interfaces inherited from interface com.vaadin.data.Buffered
Buffered.SourceException
 
Nested classes/interfaces inherited from interface com.vaadin.data.Property
Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeEvent, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.Transactional<T>, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer
 
Nested classes/interfaces inherited from interface com.vaadin.ui.Component
Component.ErrorEvent, Component.Event, Component.Focusable, Component.Listener
 
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
 
Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable
Sizeable.Unit
 
Field Summary
 
Fields inherited from interface com.vaadin.server.Sizeable
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
 
Method Summary
 void clear()
          Clears the value of the field.
 java.lang.String getRequiredError()
          Gets the error message that is to be displayed if a required field is empty.
 boolean isEmpty()
          Is the field empty? In general, "empty" state is same as null.
 boolean isRequired()
          Is this field required.
 void setRequired(boolean required)
          Sets the field required.
 void setRequiredError(java.lang.String requiredMessage)
          Sets the error message to be displayed if a required field is empty.
 
Methods inherited from interface com.vaadin.data.BufferedValidatable
isInvalidCommitted, setInvalidCommitted
 
Methods inherited from interface com.vaadin.data.Buffered
commit, discard, isBuffered, isModified, setBuffered
 
Methods inherited from interface com.vaadin.data.Validatable
addValidator, getValidators, isInvalidAllowed, isValid, removeAllValidators, removeValidator, setInvalidAllowed, validate
 
Methods inherited from interface com.vaadin.data.Property
getType, getValue, isReadOnly, setReadOnly, setValue
 
Methods inherited from interface com.vaadin.data.Property.ValueChangeNotifier
addListener, addValueChangeListener, removeListener, removeValueChangeListener
 
Methods inherited from interface com.vaadin.data.Property.ValueChangeListener
valueChange
 
Methods inherited from interface com.vaadin.data.Property.Viewer
getPropertyDataSource, setPropertyDataSource
 
Methods inherited from interface com.vaadin.ui.Component.Focusable
focus, getTabIndex, setTabIndex
 
Methods inherited from interface com.vaadin.ui.Component
addListener, addStyleName, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isReadOnly, isVisible, readDesign, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setReadOnly, setStyleName, setVisible, writeDesign
 
Methods inherited from interface com.vaadin.server.ClientConnector
addAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
 
Methods inherited from interface com.vaadin.shared.Connector
getConnectorId
 
Methods inherited from interface com.vaadin.server.Sizeable
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthUndefined
 

Method Detail

isRequired

boolean isRequired()
Is this field required. Required fields must filled by the user.

Returns:
true if the field is required,otherwise false.
Since:
3.1

setRequired

void setRequired(boolean required)
Sets the field required. Required fields must filled by the user.

Parameters:
required - Is the field required.
Since:
3.1

setRequiredError

void setRequiredError(java.lang.String requiredMessage)
Sets the error message to be displayed if a required field is empty.

Parameters:
requiredMessage - Error message.
Since:
5.2.6

getRequiredError

java.lang.String getRequiredError()
Gets the error message that is to be displayed if a required field is empty.

Returns:
Error message.
Since:
5.2.6

isEmpty

boolean isEmpty()
Is the field empty? In general, "empty" state is same as null. As an exception, TextField also treats empty string as "empty".

Returns:
true if the field is empty, false otherwise
Since:
7.4

clear

void clear()
Clears the value of the field.

The field value is typically reset to the initial value of the field. Calling isEmpty() on a cleared field must always returns true.

Since:
7.4


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.