|
|||||||||
| 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.gwtext.client.widgets.Component
com.gwtext.client.widgets.BoxComponent
com.gwtext.client.widgets.form.Field
public abstract class Field
Base class for form fields that provides default event handling, sizing, value handling and other functionality.
| Nested Class Summary |
|---|
| 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.gwtext.client.widgets.Component |
|---|
config, id |
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
Field()
|
|
Field(com.google.gwt.core.client.JavaScriptObject jsObj)
|
|
Field(java.lang.String fieldLabel)
|
|
Field(java.lang.String fieldLabel,
java.lang.String name)
|
|
Field(java.lang.String fieldLabel,
java.lang.String name,
int width)
|
|
| Method Summary | |
|---|---|
void |
addListener(FieldListener listener)
Add a Field Listener. |
void |
applyTo(com.google.gwt.user.client.Element element)
Apply the behaviors of this component to an existing element. |
void |
applyTo(java.lang.String id)
Apply the behaviors of this component to an existing element. |
void |
clearInvalid()
Clear any invalid styles/messages for this field. |
protected abstract com.google.gwt.core.client.JavaScriptObject |
create(com.google.gwt.core.client.JavaScriptObject config)
|
java.lang.String |
getClearCls()
The CSS class used to provide field clearing (defaults to 'x-form-clear-left') |
java.lang.String |
getCls()
CSS class to apply to the field's underlying element |
java.lang.String |
getFieldLabel()
The field label. |
java.lang.String |
getFocusClass()
The CSS class to use when the field receives focus (defaults to "x-form-focus"). |
java.lang.String |
getInputType()
The type attribute for input fields -- e.g. |
java.lang.String |
getInvalidClass()
The CSS class to use when marking a field invalid (defaults to "x-form-invalid"). |
java.lang.String |
getInvalidText()
The error text to use when marking a field invalid and no message is provided (defaults to "The value in this field is invalid"). |
java.lang.String |
getLabelSeparator()
The seprator between the fields label and the field. |
java.lang.String |
getLabelStyle()
The CSS style of the fields label. |
java.lang.String |
getName()
Returns the name attribute of the field if available. |
java.lang.String |
getRawValue()
Returns the raw data value which may or may not be a valid, defined value. |
int |
getTabindex()
The tabIndex for this field. |
int |
getValidationDelay()
The length of time in milliseconds after user input begins until validation is initiated (defaults to 250). |
java.lang.String |
getValueAsString()
Return the value of the field as a String. |
java.lang.String |
getXType()
Gets the xtype for this component as registered with ComponentMgr. |
void |
hide()
Hide this component. |
boolean |
isAutoCreate()
|
boolean |
isDirty()
Returns true if this field has been changed since it was originally loaded and is not disabled. |
boolean |
isHideLabel()
|
boolean |
isReadOnly()
True if read only. |
boolean |
isValid()
Returns whether or not the field value is currently valid. |
boolean |
isValid(boolean preventMark)
Returns whether or not the field value is currently valid. |
boolean |
isValidateOnBlur()
Whether the field should validate when it loses focus (defaults to true). |
void |
markInvalid(java.lang.String message)
Mark this field as invalid. |
void |
reset()
Resets the current field value to the originally loaded value and clears any validation messages. |
void |
setAutoCreate(boolean autoCreate)
Set to true for a default element spec (defaults to {tag: "input", type: "text", size: "20", autocomplete: "off"}) |
void |
setAutoCreate(DomConfig domConfig)
A DomHelper config spec to use for field creation. |
void |
setClearCls(java.lang.String clearCls)
The CSS class used to provide field clearing (defaults to 'x-form-clear-left') |
void |
setCls(java.lang.String cls)
A CSS class to apply to the field's underlying element. |
void |
setDisabled(boolean disabled)
True to disable the field (defaults to false). |
void |
setFieldClass(java.lang.String fieldClass)
The default CSS class for the field (defaults to "x-form-field"). |
void |
setFieldLabel(java.lang.String fieldLabel)
Set the fields label. |
void |
setFieldMsgTarget(java.lang.String msgTarget)
The location where error text should display. |
void |
setFocusClass(java.lang.String focusClass)
The CSS class to use when the field receives focus (defaults to "x-form-focus"). |
void |
setHideLabel(boolean hideLabel)
True to completely hide the label element (defaults to false). |
void |
setInputType(java.lang.String inputType)
The type attribute for input fields -- e.g. |
void |
setInvalidClass(java.lang.String invalidClass)
The CSS class to use when marking a field invalid (defaults to "x-form-invalid"). |
void |
setInvalidText(java.lang.String invalidText)
The error text to use when marking a field invalid and no message is provided (defaults to "The value in this field is invalid"). |
void |
setLabel(java.lang.String fieldLabel)
Set the fields label. |
void |
setLabelSeparator(java.lang.String labelSeparator)
The seprator between the fields label and the field. |
void |
setLabelStyle(java.lang.String labelStyle)
Set the CSS style of the fields label. |
void |
setMsgFx(java.lang.String msgFx)
The effect used when displaying a validation message under the field (defaults to 'normal'). |
static void |
setMsgTarget(java.lang.String msgTarget)
Set the location of the error message target globally. |
void |
setName(java.lang.String name)
Set the field's HTML name attribute. |
void |
setRawValue(java.lang.String value)
Sets the underlying DOM field's value directly, bypassing validation. |
void |
setReadOnly(boolean readOnly)
True to mark the field as readOnly in HTML (defaults to false) -- Note: this only sets the element's readOnly DOM attribute. |
void |
setTabIndex(int tabIndex)
The tabIndex for this field. |
void |
setValidateOnBlur(boolean validateOnBlur)
Whether the field should validate when it loses focus (defaults to true). |
void |
setValidationDelay(int validationDelay)
The length of time in milliseconds after user input begins until validation is initiated (defaults to 250). |
void |
setValidationEvent(boolean validationEvent)
Set to false to disable automatic validation. |
void |
setValidationEvent(java.lang.String validationEvent)
The event that should initiate field validation. |
void |
setValue(java.lang.String value)
A value to initialize this field with. |
void |
show()
Show this component. |
boolean |
validate()
|
| Methods inherited from class com.gwtext.client.widgets.BoxComponent |
|---|
addListener, doOnRender, doOnRender, getAutoHeight, getAutoWidth, getBox, getBox, getConfigPrototype, getHeight, getPosition, getPosition, getSize, getWidth, setAutoHeight, setAutoWidth, setHeight, setHeight, setPagePosition, setPosition, setSize, setSize, setWidth, setWidth, syncSize, updateBox |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
doAttachChildren, doDetachChildren, getParent, isAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, setElement, setPixelSize, setStyleName, setStyleName, setStylePrimaryName, setVisible, sinkEvents, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Field()
public Field(java.lang.String fieldLabel)
public Field(java.lang.String fieldLabel,
java.lang.String name)
public Field(java.lang.String fieldLabel,
java.lang.String name,
int width)
public Field(com.google.gwt.core.client.JavaScriptObject jsObj)
| Method Detail |
|---|
public static void setMsgTarget(java.lang.String msgTarget)
msgTarget - supported values are 'qtip' (default) and 'side'protected abstract com.google.gwt.core.client.JavaScriptObject create(com.google.gwt.core.client.JavaScriptObject config)
create in class BoxComponentpublic void applyTo(java.lang.String id)
id - the ID of the nodepublic void applyTo(com.google.gwt.user.client.Element element)
element - the elementpublic void clearInvalid()
public java.lang.String getName()
public java.lang.String getRawValue()
public java.lang.String getValueAsString()
public boolean isDirty()
public boolean isValid()
public boolean isValid(boolean preventMark)
preventMark - true to disable marking the field invalid
public void markInvalid(java.lang.String message)
message - the validation messagepublic void reset()
public void setRawValue(java.lang.String value)
setValue(String).
value - field valuepublic boolean validate()
public void addListener(FieldListener listener)
listener - the listenerpublic java.lang.String getXType()
Component
TextField field = new TextField();
field.getXType() returns "textfield"
getXType in class BoxComponent
public void setAutoCreate(boolean autoCreate)
throws java.lang.IllegalStateException
autoCreate - true for a default element spec
java.lang.IllegalStateException - this property cannot be changed after the Component has been renderedpublic boolean isAutoCreate()
public void setAutoCreate(DomConfig domConfig)
throws java.lang.IllegalStateException
domConfig - a DomHelper config spec to use for field creation
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered
public void setClearCls(java.lang.String clearCls)
throws java.lang.IllegalStateException
clearCls - the CSS class used to provide the clearing
java.lang.IllegalStateException - this property cannot be changed after the Component has been renderedpublic java.lang.String getClearCls()
public void setCls(java.lang.String cls)
throws java.lang.IllegalStateException
setCls in class Componentcls - the CSS class
java.lang.IllegalStateException - this property cannot be changed after the Component has been renderedpublic java.lang.String getCls()
getCls in class Componentpublic void setDisabled(boolean disabled)
setDisabled in class Componentdisabled - true to disable
public void setFieldClass(java.lang.String fieldClass)
throws java.lang.IllegalStateException
fieldClass - the fields class
java.lang.IllegalStateException - this property cannot be changed after the Component has been renderedpublic void setFocusClass(java.lang.String focusClass)
focusClass - CSS class on focuspublic java.lang.String getFocusClass()
public void setLabel(java.lang.String fieldLabel)
setFieldLabel(String)
fieldLabel - the field labelpublic void setFieldLabel(java.lang.String fieldLabel)
fieldLabel - the field labelpublic java.lang.String getFieldLabel()
public void hide()
Component
hide in class Componentpublic void show()
Component
show in class Component
public void setHideLabel(boolean hideLabel)
throws java.lang.IllegalStateException
hideLabel - true to completely hide the label element (defaults to false)
java.lang.IllegalStateException - this property cannot be changed after the Component has been renderedpublic boolean isHideLabel()
public void setInputType(java.lang.String inputType)
throws java.lang.IllegalStateException
inputType - the input type
java.lang.IllegalStateException - this property cannot be changed after the Component has been renderedpublic java.lang.String getInputType()
public void setInvalidClass(java.lang.String invalidClass)
invalidClass - CSS class when field is invalidpublic java.lang.String getInvalidClass()
public void setInvalidText(java.lang.String invalidText)
invalidText - invalid text on errorTextField.setValidator(Validator)public java.lang.String getInvalidText()
public void setLabelStyle(java.lang.String labelStyle)
throws java.lang.IllegalStateException
labelStyle - the CSS style for the fields label
java.lang.IllegalStateException - this property cannot be changed after the Component has been renderedpublic java.lang.String getLabelStyle()
public void setLabelSeparator(java.lang.String labelSeparator)
throws java.lang.IllegalStateException
labelSeparator - the label separator
java.lang.IllegalStateException - this property cannot be changed after the Component has been renderedpublic java.lang.String getLabelSeparator()
public void setMsgFx(java.lang.String msgFx)
msgFx - validation message style
public void setFieldMsgTarget(java.lang.String msgTarget)
throws java.lang.IllegalStateException
Value Description ----------- ---------------------------------------------------------------------- qtip Display a quick tip when the user hovers over the field title Display a default browser title attribute popup under Add a block div beneath the field containing the error text side Add an error icon to the right of the field with a popup on hover [element id] Add the error text directly to the innerHTML of the specified element
msgTarget - the error message target
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered
public void setName(java.lang.String name)
throws java.lang.IllegalStateException
name - the fields name
java.lang.IllegalStateException - this property cannot be changed after the Component has been renderedpublic void setReadOnly(boolean readOnly)
readOnly - true to mark field read onlypublic boolean isReadOnly()
public void setTabIndex(int tabIndex)
throws java.lang.IllegalStateException
tabIndex - the fields tab index
java.lang.IllegalStateException - this property cannot be changed after the Component has been renderedpublic int getTabindex()
public void setValidateOnBlur(boolean validateOnBlur)
validateOnBlur - true to validate on blurpublic boolean isValidateOnBlur()
public void setValidationDelay(int validationDelay)
throws java.lang.IllegalStateException
validationDelay - the validation delay in milliseconds
java.lang.IllegalStateException - this property cannot be changed after the Component has been renderedpublic int getValidationDelay()
public void setValidationEvent(boolean validationEvent)
throws java.lang.IllegalStateException
validationEvent - false to disable automatic validation
java.lang.IllegalStateException - this property cannot be changed after the Component has been renderedpublic void setValidationEvent(java.lang.String validationEvent)
validationEvent - event to initiate validationpublic void setValue(java.lang.String value)
value - the field value
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||