|
|||||||||
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
com.gwtext.client.widgets.form.TextField
com.gwtext.client.widgets.form.ComboBox
public class ComboBox
A combobox control with support for autocomplete, remote-loading, paging and many other features.
Nested Class Summary | |
---|---|
static class |
ComboBox.Mode
|
static class |
ComboBox.Trigger
|
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 | |
---|---|
static ComboBox.Trigger |
ALL
|
static ComboBox.Mode |
LOCAL
|
static ComboBox.Trigger |
QUERY
|
static ComboBox.Mode |
REMOTE
|
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 | |
---|---|
ComboBox()
|
|
ComboBox(com.google.gwt.core.client.JavaScriptObject jsObj)
|
|
ComboBox(java.lang.String fieldLabel)
Create a new ComboBox. |
|
ComboBox(java.lang.String fieldLabel,
java.lang.String name)
Create a new ComboBox. |
|
ComboBox(java.lang.String fieldLabel,
java.lang.String name,
int width)
Create a new ComboBox. |
Method Summary | |
---|---|
void |
addListener(ComboBoxListener listener)
Add a Combobox listener. |
void |
clearValue()
Clears any text/value currently set in the field |
void |
collapse()
Hides the dropdown list if it is currently expanded. |
protected com.google.gwt.core.client.JavaScriptObject |
create(com.google.gwt.core.client.JavaScriptObject jsObj)
|
void |
doQuery(java.lang.String query,
boolean forceAll)
Execute a query to filter the dropdown list. |
void |
expand()
Expands the dropdown list if it is currently hidden. |
protected com.google.gwt.core.client.JavaScriptObject |
getConfigPrototype()
|
protected com.google.gwt.user.client.Element |
getElement(com.google.gwt.core.client.JavaScriptObject jsObj)
|
int |
getMinHeight()
Return the min height. |
Store |
getStore()
The Store associated with the combobox. |
java.lang.String |
getValue()
Returns the currently selected field value or null if no value is set. |
java.lang.String |
getXType()
Gets the xtype for this component as registered with ComponentMgr. |
boolean |
isExpanded()
Returns true if the dropdown list is expanded, else false. |
protected void |
onDestroy()
This template method is called on component destroy. |
void |
select(int index,
boolean scrollIntoView)
Select an item in the dropdown list by its numeric index in the list. |
void |
selectByValue(java.lang.String value,
boolean scrollIntoView)
Select an item in the dropdown list by its data value. |
void |
setAllQuery(java.lang.String allQuery)
The text query to send to the server to return all records for the list with no filtering (defaults to '') |
void |
setDisplayField(java.lang.String displayField)
The underlying data field name to bind to this ComboBox (defaults to undefined). |
void |
setEditable(boolean editable)
False to prevent the user from typing text directly into the field, just like a traditional select (defaults to true). |
void |
setForceSelection(boolean forceSelection)
True to restrict the selected value to one of the values in the list, false to allow the user to set arbitrary text into the field (defaults to false) |
void |
setHandleHeight(int handleHeight)
The height in pixels of the dropdown list resize handle if resizable = true (defaults to 8) |
void |
setHiddenName(java.lang.String hiddenName)
If specified, a hidden form field with this name is dynamically generated to store the field's data value (defaults to the underlying DOM element's name) |
void |
setHideTrigger(boolean hideTrigger)
True to hide the trigger element and display only the base text field (defaults to false). |
void |
setItemSelector(java.lang.String itemSelector)
A CSS selector in any format supported by DomQuery that will be used to determine
what nodes this DataView will be working with. |
void |
setLazyRender(boolean lazyRender)
True to prevent the ComboBox from rendering until requested (should always be used when rendering into an Editor, defaults to false). |
void |
setLinked(boolean linked)
True to indicate this is a linked combo box. |
void |
setListAlign(java.lang.String anchorPosition)
A valid anchor position value. |
void |
setListClass(java.lang.String listClass)
CSS class to apply to the dropdown list element (defaults to ''). |
void |
setListWidth(int listWidth)
The width in pixels of the dropdown list (defaults to the width of the ComboBox field) |
void |
setLoadingText(java.lang.String loadingText)
The text to display in the dropdown list while data is loading. |
void |
setMaxHeight(int maxHeight)
The maximum height in pixels of the dropdown list before scrollbars are shown (defaults to 300). |
void |
setMinChars(int minChars)
The minimum number of characters the user must type before autocomplete and typeahead activate (defaults to 4, does not apply if editable = false) |
void |
setMinHeight(int minHeight)
Set the min height. |
void |
setMinListWidth(int minListWidth)
The minimum width of the dropdown list in pixels (defaults to 70, will be ignored if listWidth has a higher value). |
void |
setMode(ComboBox.Mode mode)
Set to LOCAL if the ComboBox loads local data. |
void |
setPageSize(int pageSize)
If greater than 0, a paging toolbar is displayed in the footer of the dropdown list and the filter queries will execute with page start and limit parameters. |
void |
setQueryDelay(int queryDelay)
The length of time in milliseconds to delay between the start of typing and sending the query to filter the dropdown list (defaults to 500 if mode = 'remote' or 10 if mode = 'local') |
void |
setQueryParam(java.lang.String queryParam)
Name of the query as it will be passed on the querystring (defaults to 'query') |
void |
setResizable(boolean resizable)
True to add a resize handle to the bottom of the dropdown list (defaults to false). |
void |
setSelectedClass(java.lang.String selectedClass)
CSS class to apply to the selected item in the dropdown list (defaults to 'x-combo-selected') |
void |
setShadow(boolean shadow)
True for default effect |
void |
setShadow(Shadow.Type shadow)
"sides" for the default effect, "frame" for 4-way shadow, and "drop" for bottom-right. |
void |
setStore(Store store)
The data store to which this combo is bound (defaults to undefined) |
void |
setTitle(java.lang.String title)
If supplied, a header element is created containing this text and added into the top of the dropdown list (defaults to undefined, with no header element). |
void |
setTpl(java.lang.String template)
Set the template to use to render the ComboBox items. |
void |
setTpl(Template template)
Set the template to use to render the ComboBox items. |
void |
setTriggerAction(ComboBox.Trigger triggerAction)
The action to execute when the trigger field is activated. |
void |
setTriggerClass(java.lang.String triggerClass)
A CSS class to apply to the trigger. |
void |
setTypeAhead(boolean typeAhead)
True to populate and autoselect the remainder of the text being typed after a configurable delay (typeAheadDelay) if it matches a known value (defaults to false). |
void |
setTypeAheadDelay(int typeAheadDelay)
The length of time in milliseconds to wait until the typeahead text is displayed if typeAhead = true (defaults to 250) |
void |
setValue(java.lang.String value)
Sets the specified value into the field. |
void |
setValueField(java.lang.String valueField)
The underlying data value name to bind to this CombBox (defaults to undefined). |
void |
setValueNotFoundText(java.lang.String valueNotFoundText)
When using a name/value combo, if the value passed to setValue is not found in the store, valueNotFoundText will be displayed as the field text if defined (defaults to undefined). |
Methods inherited from class com.gwtext.client.widgets.form.TextField |
---|
addKeyListener, addKeyListener, addKeyListener, addKeyPressListener, addKeyPressListener, addListener, autoSize, getCaretPosition, getText, getValidator, insertAtCaret, selectText, selectText, setAllowBlank, setBlankText, setCaretPosition, 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, 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.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 |
Field Detail |
---|
public static ComboBox.Mode REMOTE
public static ComboBox.Mode LOCAL
public static ComboBox.Trigger ALL
public static ComboBox.Trigger QUERY
Constructor Detail |
---|
public ComboBox()
public ComboBox(java.lang.String fieldLabel)
fieldLabel
- the field labelpublic ComboBox(java.lang.String fieldLabel, java.lang.String name)
fieldLabel
- the field labelname
- the field namepublic ComboBox(java.lang.String fieldLabel, java.lang.String name, int width)
fieldLabel
- the field labelname
- the field namewidth
- the field widthpublic ComboBox(com.google.gwt.core.client.JavaScriptObject jsObj)
Method Detail |
---|
protected com.google.gwt.core.client.JavaScriptObject getConfigPrototype()
getConfigPrototype
in class TextField
public java.lang.String getXType()
Component
TextField field = new TextField();
field.getXType() returns "textfield"
getXType
in class TextField
protected com.google.gwt.core.client.JavaScriptObject create(com.google.gwt.core.client.JavaScriptObject jsObj)
create
in class TextField
protected void onDestroy()
Component
onDestroy
in class Component
protected com.google.gwt.user.client.Element getElement(com.google.gwt.core.client.JavaScriptObject jsObj)
getElement
in class Component
public void clearValue()
public void collapse()
public void doQuery(java.lang.String query, boolean forceAll)
query
- the query to executeforceAll
- true to force the query to execute even if there are currently fewer characters in the field than the minimum specified by the minChars config option.
It also clears any filter previously saved in the current store (defaults to false)public void expand()
public java.lang.String getValue()
public boolean isExpanded()
public void select(int index, boolean scrollIntoView)
index
- the zero-based index of the list item to selectscrollIntoView
- false to prevent the dropdown list from autoscrolling to display the selected item if it is
not currently in view (defaults to true)public void selectByValue(java.lang.String value, boolean scrollIntoView)
value
- the data value of the item to selectscrollIntoView
- false to prevent the dropdown list from autoscrolling to display the selected item if it is not currently in view (defaults to true)public void setValue(java.lang.String value)
setValue
in class Field
value
- the field valuepublic void addListener(ComboBoxListener listener)
listener
- the listenerpublic void setAllQuery(java.lang.String allQuery) throws java.lang.IllegalStateException
allQuery
- the all query string
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setDisplayField(java.lang.String displayField) throws java.lang.IllegalStateException
displayField
- the display field
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setEditable(boolean editable)
editable
- false to disable editingpublic void setForceSelection(boolean forceSelection) throws java.lang.IllegalStateException
forceSelection
- true to force selection
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setHandleHeight(int handleHeight) throws java.lang.IllegalStateException
handleHeight
- the handle height
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setHiddenName(java.lang.String hiddenName) throws java.lang.IllegalStateException
hiddenName
- the hidden name
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setHideTrigger(boolean hideTrigger) throws java.lang.IllegalStateException
hideTrigger
- true to hide trigger
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setTriggerClass(java.lang.String triggerClass) throws java.lang.IllegalStateException
triggerClass
- the trigger CSS class.
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setItemSelector(java.lang.String itemSelector)
DomQuery
that will be used to determine
what nodes this DataView will be working with.
itemSelector
- the items selectorpublic void setLinked(boolean linked) throws java.lang.IllegalStateException
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setLazyRender(boolean lazyRender) throws java.lang.IllegalStateException
lazyRender
- true to lazy render
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setListAlign(java.lang.String anchorPosition) throws java.lang.IllegalStateException
anchorPosition
- the anchor position
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setListClass(java.lang.String listClass)
listClass
- list css classpublic void setListWidth(int listWidth) throws java.lang.IllegalStateException
listWidth
- the list width
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setLoadingText(java.lang.String loadingText)
loadingText
- the loading textpublic void setMaxHeight(int maxHeight) throws java.lang.IllegalStateException
maxHeight
- the max height
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setMinChars(int minChars)
minChars
- the min chars before autocompletepublic void setMinHeight(int minHeight)
minHeight
- the minHeight
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic int getMinHeight()
public void setMinListWidth(int minListWidth) throws java.lang.IllegalStateException
minListWidth
- the min list width
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setMode(ComboBox.Mode mode)
LOCAL
if the ComboBox loads local data.
(defaults to REMOTE
which loads from the server)
mode
- local or remote modepublic void setPageSize(int pageSize) throws java.lang.IllegalStateException
pageSize
- the page size
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedsetMode(com.gwtext.client.widgets.form.ComboBox.Mode)
public void setQueryDelay(int queryDelay) throws java.lang.IllegalStateException
queryDelay
- query delay in milliseconds
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedsetMode(com.gwtext.client.widgets.form.ComboBox.Mode)
public void setQueryParam(java.lang.String queryParam) throws java.lang.IllegalStateException
queryParam
- the query param
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setResizable(boolean resizable) throws java.lang.IllegalStateException
resizable
- true for resizale
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setSelectedClass(java.lang.String selectedClass) throws java.lang.IllegalStateException
selectedClass
- the selected css class
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setShadow(boolean shadow) throws java.lang.IllegalStateException
shadow
- true to enable shadow
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setShadow(Shadow.Type shadow) throws java.lang.IllegalStateException
shadow
- shadow style
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setStore(Store store) throws java.lang.IllegalStateException
store
- the combobox store
java.lang.IllegalStateException
public Store getStore()
public void setTitle(java.lang.String title) throws java.lang.IllegalStateException
setTitle
in class Component
title
- the combobox title
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setTpl(Template template) throws java.lang.IllegalStateException
template
- template to use for rendering items.
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedStore
,
RecordDef
public void setTpl(java.lang.String template) throws java.lang.IllegalStateException
template
- template to use for rendering items.
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedStore
,
RecordDef
public void setTriggerAction(ComboBox.Trigger triggerAction) throws java.lang.IllegalStateException
triggerAction
- the trigger action
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setTypeAhead(boolean typeAhead) throws java.lang.IllegalStateException
typeAhead
- enable type ahead
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setTypeAheadDelay(int typeAheadDelay) throws java.lang.IllegalStateException
typeAheadDelay
- typeahead delay in milliseconds
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setValueField(java.lang.String valueField)
valueField
- the value fieldpublic void setValueNotFoundText(java.lang.String valueNotFoundText)
valueNotFoundText
- text when value not found
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |