|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.extjs.gxt.ui.client.widget.Component
com.extjs.gxt.ui.client.widget.BoxComponent
com.extjs.gxt.ui.client.widget.form.Field<D>
D - the data type of the fieldpublic abstract class Field<D>
Base class for form fields that provides default event handling, value handling and other functionality.
| Nested Class Summary | |
|---|---|
class |
Field.FieldImages
|
class |
Field.FieldMessages
The field messages. |
| Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
| Field Summary |
|---|
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Method Summary | |
|---|---|
void |
addInputStyleName(java.lang.String style)
Adds a CSS style name to the input element of this field. |
void |
addKeyListener(KeyListener listener)
Adds a key listener. |
void |
clearInvalid()
Clear any invalid styles / messages for this field. |
void |
focus()
Try to focus this component. |
void |
forceInvalid(java.lang.String msg)
Forces the field to be invalid using the given error message. |
boolean |
getAutoValidate()
Returns true if the field value is validated on each key press. |
java.lang.String |
getEmptyText()
Returns the field's empty text. |
java.lang.String |
getErrorMessage()
Returns the active error message as string |
java.lang.String |
getFieldLabel()
Returns the field's label. |
Field.FieldImages |
getImages()
|
java.lang.String |
getLabelSeparator()
Returns the field's label separator. |
java.lang.String |
getLabelStyle()
Returns the field's label style. |
Field.FieldMessages |
getMessages()
Returns the field's messages. |
java.lang.String |
getMessageTarget()
Returns the field's message target. |
java.lang.String |
getName()
Returns the name attribute of the field if available. |
D |
getOriginalValue()
Returns the original value of the field, which is the value of the field when it is first rendered. |
PropertyEditor<D> |
getPropertyEditor()
Returns the field's property editor. |
java.lang.String |
getRawValue()
Returns the raw data value which may or may not be a valid, defined value. |
boolean |
getValidateOnBlur()
Returns true if the value is validate on blur. |
int |
getValidationDelay()
Returns the field's validation delay in milliseconds. |
D |
getValue()
Returns the typed value of the field. |
boolean |
isDirty()
Returns true if this field is dirty. |
boolean |
isFireChangeEventOnSetValue()
Returns true if a change event is fired when setValue(Object) is
called. |
boolean |
isHideLabel()
Returns true if the label is hidden. |
boolean |
isInEditor()
Returns true if the field is inside an editor. |
boolean |
isReadOnly()
Returns the read only state. |
boolean |
isValid()
|
boolean |
isValid(boolean preventMark)
Returns whether or not the field value is currently valid. |
void |
markInvalid(java.lang.String msg)
Marks this field as invalid. |
void |
onComponentEvent(ComponentEvent ce)
Any events a component receives will be forwarded to this method. |
void |
removeInputStyleName(java.lang.String style)
Removes a CSS style name from the input element of this field. |
void |
removeKeyListener(KeyListener listener)
Removes the key listener. |
void |
reset()
Resets the current field value to the originally loaded value and clears any validation messages. |
void |
setAutoValidate(boolean autoValidate)
Sets whether the value is validated on each key press (defaults to false). |
void |
setEmptyText(java.lang.String emptyText)
Sets the default text to display in an empty field. |
void |
setFieldLabel(java.lang.String fieldLabel)
Sets the field's label. |
void |
setFireChangeEventOnSetValue(boolean fireChangeEventOnSetValue)
True to fire a change event when setValue(Object) is called
(defaults to false). |
void |
setHideLabel(boolean hideLabel)
True to completely hide the label element (defaults to false, pre-render). |
void |
setImages(Field.FieldImages images)
|
void |
setInEditor(boolean inEditor)
True to mark this field being in an editor. |
void |
setLabelSeparator(java.lang.String labelSeparator)
The standard separator to display after the text of each form label (defaults to the value of FormLayout.setLabelSeparator(String),
which is a colon ':' by default). |
void |
setLabelStyle(java.lang.String labelStyle)
A CSS style specification to apply directly to this field's label. |
void |
setMessages(Field.FieldMessages messages)
Sets the field's messages. |
void |
setMessageTarget(java.lang.String messageTarget)
The location where error text should display. |
void |
setName(java.lang.String name)
Sets the field's HTML name attribute. |
void |
setOriginalValue(D originalValue)
Updates the original value of the field. |
void |
setPropertyEditor(PropertyEditor<D> propertyEditor)
Sets the field's property editor which is used to translate typed values to string, and string values back to typed values. |
void |
setRawValue(java.lang.String value)
Sets the underlying DOM field's value directly, bypassing validation. |
void |
setReadOnly(boolean readOnly)
Sets the field's read only state. |
void |
setTabIndex(int index)
Sets the tab index. |
void |
setValidateOnBlur(boolean validateOnBlur)
Sets whether the field should validate when it loses focus (defaults to true). |
void |
setValidationDelay(int validationDelay)
Sets length of time in milliseconds after user input begins until validation is initiated (defaults to 250). |
void |
setValue(D value)
Sets a data value into the field and validates it. |
void |
updateOriginalValue(D value)
Updates the original value of the field. |
boolean |
validate()
Validates the field value. |
boolean |
validate(boolean preventMark)
Validates the field value. |
| Methods inherited from class com.extjs.gxt.ui.client.widget.BoxComponent |
|---|
getBounds, getHeight, getHeight, getPosition, getShadow, getShadowOffset, getShadowPosition, getSize, getWidth, getWidth, isAutoHeight, isAutoWidth, isDeferHeight, isShim, setAutoHeight, setAutoWidth, setBounds, setBounds, setDeferHeight, setHeight, setHeight, setPagePosition, setPagePosition, setPixelSize, setPosition, setShadow, setShadowOffset, setShadowPosition, setShim, setSize, setSize, setWidth, setWidth, sync, syncSize |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
fireEvent, getParent, isAttached |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, setStylePrimaryName, setVisible, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public void addInputStyleName(java.lang.String style)
style - the style namepublic void addKeyListener(KeyListener listener)
listener - the key listenerpublic void clearInvalid()
public void focus()
Component
focus in class Componentpublic void forceInvalid(java.lang.String msg)
clearInvalid() must be called to clear the error.
Also, no other validation logic will execute.
msg - the error textpublic boolean getAutoValidate()
public java.lang.String getEmptyText()
public java.lang.String getErrorMessage()
public java.lang.String getFieldLabel()
public Field.FieldImages getImages()
public java.lang.String getLabelSeparator()
public java.lang.String getLabelStyle()
public Field.FieldMessages getMessages()
public java.lang.String getMessageTarget()
public java.lang.String getName()
public D getOriginalValue()
public PropertyEditor<D> getPropertyEditor()
public java.lang.String getRawValue()
getValue().
public boolean getValidateOnBlur()
public int getValidationDelay()
public D getValue()
public boolean isDirty()
true if this field is dirty. A field is dirty, if the
current value is different than it's original value. The original value is
the value of the field when the field is rendered. Disabled and
pre-rendered fields are never dirty.
public boolean isFireChangeEventOnSetValue()
setValue(Object) is
called.
public boolean isHideLabel()
public boolean isInEditor()
public boolean isReadOnly()
true if read only, otherwise falsepublic boolean isValid()
public boolean isValid(boolean preventMark)
preventMark - true for silent validation (no invalid event and field
is not marked invalid)
true if the value is valid, otherwise
falsepublic void markInvalid(java.lang.String msg)
forceInvalid(String)
msg - the validation messagepublic void onComponentEvent(ComponentEvent ce)
ComponentComponent.onBrowserEvent(com.google.gwt.user.client.Event) method
should not be overridden or modified.
onComponentEvent in class Componentce - the base eventpublic void removeInputStyleName(java.lang.String style)
style - the style namepublic void removeKeyListener(KeyListener listener)
listener - the key listenerpublic void reset()
public void setAutoValidate(boolean autoValidate)
autoValidate - true to validate on each key presspublic void setEmptyText(java.lang.String emptyText)
emptyText - the empty textpublic void setFieldLabel(java.lang.String fieldLabel)
fieldLabel - the labelpublic void setFireChangeEventOnSetValue(boolean fireChangeEventOnSetValue)
setValue(Object) is called
(defaults to false).
fireChangeEventOnSetValue - true to fire a change eventpublic void setHideLabel(boolean hideLabel)
hideLabel - true to hide the labelpublic void setImages(Field.FieldImages images)
public void setInEditor(boolean inEditor)
inEditor - true mark this field being in an editorpublic void setLabelSeparator(java.lang.String labelSeparator)
FormLayout.setLabelSeparator(String),
which is a colon ':' by default).
labelSeparator - the label separator or "" for nonepublic void setLabelStyle(java.lang.String labelStyle)
labelStyle: 'font-weight:bold;'
labelStyle - the label stylepublic void setMessages(Field.FieldMessages messages)
messages - the messagespublic void setMessageTarget(java.lang.String messageTarget)
Value Description
----------- ----------------------------------------------------------------------
tooltip Display a tool tip when the user hovers over the field
title Display a default browser title attribute popup
side Add an error icon to the right of the field with a popup on hover
none Do not display an error message
[element id] Add the error text directly to the innerHTML of the specified element
messageTarget - the message targetpublic void setName(java.lang.String name)
name - the namepublic void setOriginalValue(D originalValue)
originalValue - the original valuepublic void setPropertyEditor(PropertyEditor<D> propertyEditor)
propertyEditor - the property editorpublic void setRawValue(java.lang.String value)
setValue(D).
value - the raw valuepublic void setReadOnly(boolean readOnly)
readOnly - the read only statepublic void setTabIndex(int index)
index - the tab index valuepublic void setValidateOnBlur(boolean validateOnBlur)
validateOnBlur - true to validate on blur, otherwise falsepublic void setValidationDelay(int validationDelay)
validationDelay - the delay in millisecondspublic void setValue(D value)
setRawValue(java.lang.String).
value - the value to setpublic void updateOriginalValue(D value)
value - the new original valuepublic boolean validate()
true if valid, otherwise falsepublic boolean validate(boolean preventMark)
preventMark - true to not mark the field valid and fire invalid event
when invalid
true if valid, otherwise false
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||