VALUE
- is the generic type of the value
.public interface UiWidgetField<VALUE> extends UiWidgetRegularComposite<UiWidget>, UiWidgetWithValue<VALUE>, AttributeWriteValueAsString, AttributeWriteValidationFailure, AttributeWriteTrimValue, AttributeWriteLabel, UiWidgetActive
regular composite widget
that
represents a (potentially) editable field (text field, combobox, text area, radio-buttons, checkbox, etc.).
Such a field is associated with a label
. To build a form with multiple fields a
UiWidgetGridPanel
should be used (typically indirectly via a
custom widget). Such form can be used to display the fields with their values in
view mode
(read-only) or in
edit mode
. This can be changed dynamically via
AttributeWriteMode.setMode(net.sf.mmm.client.ui.api.common.UiMode)
. To prevent a single field from switching to
edit mode
you can call
AttributeWriteModeFixed.setModeFixed(net.sf.mmm.client.ui.api.common.UiMode)
with
UiMode.VIEW
so it will remain immutable. Besides a field can also
be disabled
so in edit mode
it
will be grayed out and prevents the user from changing its value. This is suggested for fields that
dynamically change their ( editable
) status based on a particular condition (e.g. the
current value of another field). A field widget is a composite because it may also be composed out of
multiple native input widgets (e.g. to edit a composite Datatype
- see
UiWidgetFactoryDatatype.createForDatatype(Class)
).Modifier and Type | Field and Description |
---|---|
static String |
STYLE_FIELD
The default top-level
style of this widget. |
static String |
STYLE_LABEL
The
primary style of the field label widget . |
static String |
STYLE_MANDATORY
|
static String |
STYLE_VIEW
|
STYLE_HEADER
HTML_ATTRIBUTE_ID, ID_SEPARATOR, PROPERTY_ID
PROPERTY_STYLES, STYLE_PATTERN_MULTIPLE, STYLE_PATTERN_SINGLE
WAI_ARIA
PROPERTY_LABEL
ACCESS_KEY_NONE, HTML_ATTRIBUTE_ACCESS_KEY
Modifier and Type | Method and Description |
---|---|
String |
getLabel()
This method gets the label of this object.
|
UiWidgetLabel |
getLabelWidget()
This method gets the
label widget associated with this field. |
void |
setLabel(String label)
This method sets the
label of this object. |
getChild, getChild
getChildCount, getChildIndex
getContext, getParent, getSize
clearMessages
addEventHandler, removeEventHandler
setMode
getMode
setModeFixed
getModeFixed
setId
getId
setTooltip
getTooltip
getVisibleFlag, isVisible, setVisible, setVisible
isVisibleRecursive
setEnabled
isEnabled
addStyle, removeStyle
hasStyle
setStyles
getStyles
setPrimaryStyle
getPrimaryStyle
dispose
isDisposed
isModified
getAriaRole
getValue
getValueAndValidate, getValueDirect
addChangeHandler, removeChangeHandler
resetValue, setValue, setValue, setValueForUser
getOriginalValue, getValueOrException
addValidatorMandatory, isMandatory
addValidator, removeValidator
setValueAsString
getValueAsString
setValidationFailure
getValidationFailure
setTrimValue
isTrimValue
setAccessKey
getAccessKey
addFocusHandler, removeFocusHandler
isFocused
setFocused
static final String STYLE_FIELD
style
of this widget.static final String STYLE_VIEW
static final String STYLE_LABEL
primary style
of the field label widget
.static final String STYLE_MANDATORY
String getLabel()
UiWidgetField
) has an associated label widget
. This
method gets its label text. Please note that the label widget
is not contained
in this field widget itself, so if you regularly add this field widget to some other widget you will not
see the label. However, UiWidgetGridPanel
also
automatically
adds
the label widget
. The recommended use-case is to create a form to view
and edit your business object extending
UiWidgetCustomGridPanel
and use
UiDataBinding
. getLabelWidget()
.getLabel()
this method
prevents actually creating the label widget
if it does NOT yet exist. Further
it will only return what has been set via setLabel(String)
and NOT what has potentially been set
via getLabelWidget()
. setLabel
(what should be avoided).getLabel
in interface AttributeReadLabel
void setLabel(String label)
label
of this object.setLabel
in interface AttributeWriteLabel
label
- is the new label
to set.getLabel()
UiWidgetLabel getLabelWidget()
label widget
associated with this field. getLabel()
and
setLabel(String)
. Be aware that some native toolkits (e.g. SmartGWT) already implement field
widgets including the label. In this case this method will return a different view on the same native
widget.Copyright © 2001–2016 mmm-Team. All rights reserved.