com.gwtext.client.widgets.form
Class TriggerField

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.gwtext.client.widgets.Component
              extended by com.gwtext.client.widgets.BoxComponent
                  extended by com.gwtext.client.widgets.form.Field
                      extended by com.gwtext.client.widgets.form.TextField
                          extended by com.gwtext.client.widgets.form.TriggerField
All Implemented Interfaces:
com.google.gwt.user.client.EventListener, Observable

public abstract class TriggerField
extends TextField

Provides a convenient wrapper for TextFields that adds a clickable trigger button (looks like a combobox by default). The trigger has no default action, so you mustimplement the trigger click handler by overriding onTriggerClick(com.gwtext.client.core.EventObject). You can create a TriggerField directly, as it renders exactly like a combobox for which you can provide a custom implementation.


Field Summary
 
Fields inherited from class com.gwtext.client.widgets.Component
config, id
 
Constructor Summary
TriggerField()
          Construct a new TriggerField.
TriggerField(com.google.gwt.core.client.JavaScriptObject jsObj)
           
 
Method Summary
protected  com.google.gwt.core.client.JavaScriptObject create(com.google.gwt.core.client.JavaScriptObject jsObj)
           
protected  com.google.gwt.user.client.Element getElement(com.google.gwt.core.client.JavaScriptObject jsObj)
           
 java.lang.String getXType()
          Gets the xtype for this component as registered with ComponentMgr.
protected  void initComponent()
          This template method is called after the Component has been instantiated but before it's rendered.
protected abstract  void onTriggerClick(EventObject event)
          Abstract method that must be implmented for custom trigger field behavior.
 void setHideTrigger(boolean hideTrigger)
          True to hide the trigger element and display only the base text field (defaults to false).
 void setTriggerClass(java.lang.String triggerClass)
          A CSS class to apply to the trigger.
 
Methods inherited from class com.gwtext.client.widgets.form.TextField
addKeyListener, addKeyListener, addKeyListener, addKeyPressListener, addKeyPressListener, addListener, autoSize, getConfigPrototype, getText, selectText, selectText, setAllowBlank, setBlankText, setDisableKeyFilter, setEmptyClass, setEmptyText, setGrow, setGrowMax, setGrowMin, setMaskRe, setMaxLength, setMaxLengthText, setMinLength, setMinLengthText, setPassword, setRegex, setRegexText, setSelectOnFocus, setValidator, setVtype, setVtypeText, validateValue
 
Methods inherited from class com.gwtext.client.widgets.form.Field
addListener, applyTo, applyTo, clearInvalid, getClearCls, getCls, getFieldLabel, getFocusClass, getInputType, getInvalidClass, getInvalidText, getLabelSeparator, getLabelStyle, getName, getRawValue, getTabindex, getValidationDelay, getValueAsString, hide, isAutoCreate, isDirty, isHideLabel, isReadOnly, isValid, isValid, isValidateOnBlur, markInvalid, reset, setAutoCreate, setAutoCreate, setClearCls, setCls, setDisabled, setFieldClass, setFieldLabel, setFieldMsgTarget, setFocusClass, setHideLabel, setInputType, setInvalidClass, setInvalidText, setLabel, setLabelSeparator, setLabelStyle, setMsgFx, setMsgTarget, setName, setRawValue, setReadOnly, setTabIndex, setValidateOnBlur, setValidationDelay, setValidationEvent, setValidationEvent, setValue, show, validate
 
Methods inherited from class com.gwtext.client.widgets.BoxComponent
addListener, doOnRender, doOnRender, getAutoHeight, getAutoWidth, getBox, getBox, getHeight, getPosition, getPosition, getSize, getWidth, setAutoHeight, setAutoWidth, setHeight, setHeight, setPagePosition, setPosition, setSize, setSize, setWidth, setWidth, syncSize, updateBox
 
Methods inherited from class com.gwtext.client.widgets.Component
addClass, addClassCreated, addEvent, addEvents, addListener, addListener, addListener, addPlugin, addStyleDependentName, addStyleName, afterRender, beforeDestroy, check, checkExtVer, cloneComponent, cloneComponent, cloneConfig, destroy, disable, enable, equals, error, findParentBy, findParentByType, fireEvent, focus, focus, focus, getApplyTo, getAttribute, getAttributeAsBoolean, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAutoShow, getComponentJS, getConfig, getConfigAsString, getCtCls, getDisabledClass, getEl, getElement, getElement, getHideMode, getHideParent, getId, getItemId, getJsObj, getOffsetHeight, getOffsetWidth, getOrCreateJsObj, getOwnerContainer, getRenderTo, getStateEvents, getStateId, getTitle, getXTypes, hashCode, isCreated, isDisabled, isHidden, isRendered, isVisible, isXType, isXType, onDestroy, purgeListeners, removeClass, removeStyleDependentName, removeStyleName, render, render, render, render, render, render, resumeEvents, setApplyTo, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAutoEl, setAutoEl, setAutoShow, setCtCls, setDisabledClass, setEl, setEl, setElement, setHideMode, setHideParent, setId, setRenderTo, setRenderToID, setStateEvents, setStateId, setStyle, setStyle, setStyleName, setStylePrimaryName, setTitle, setVisible, suspendEvents, toString
 
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
getAbsoluteLeft, getAbsoluteTop, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, setPixelSize, setStyleName, setStyleName, setStylePrimaryName, setVisible, sinkEvents, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TriggerField

public TriggerField()
Construct a new TriggerField.


TriggerField

public TriggerField(com.google.gwt.core.client.JavaScriptObject jsObj)
Method Detail

initComponent

protected void initComponent()
Description copied from class: Component
This template method is called after the Component has been instantiated but before it's rendered. Subclasses can override it to provide any "constructor" type logic thats desired/

Overrides:
initComponent in class Component

getElement

protected com.google.gwt.user.client.Element getElement(com.google.gwt.core.client.JavaScriptObject jsObj)
Overrides:
getElement in class Component

create

protected com.google.gwt.core.client.JavaScriptObject create(com.google.gwt.core.client.JavaScriptObject jsObj)
Overrides:
create in class TextField

onTriggerClick

protected abstract void onTriggerClick(EventObject event)
Abstract method that must be implmented for custom trigger field behavior.

Parameters:
event - the event object

getXType

public java.lang.String getXType()
Description copied from class: Component
Gets the xtype for this component as registered with ComponentMgr. For a list of all available xtypes, see the Component javadocs.

 
 

TextField field = new TextField(); field.getXType() returns "textfield"

Overrides:
getXType in class TextField
Returns:
the xtype

setHideTrigger

public void setHideTrigger(boolean hideTrigger)
                    throws java.lang.IllegalStateException
True to hide the trigger element and display only the base text field (defaults to false).

Parameters:
hideTrigger - true to hide trigger
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered

setTriggerClass

public void setTriggerClass(java.lang.String triggerClass)
                     throws java.lang.IllegalStateException
A CSS class to apply to the trigger.

Parameters:
triggerClass - the trigger CSS class.
Throws:
java.lang.IllegalStateException - this property cannot be changed after the Component has been rendered